[TYPO3-dev] Extensions need update for 4.3!

Dmitry Dulepov dmitry at typo3.org
Fri Oct 10 09:24:23 CEST 2008


Hi!

Steffen Kamper wrote:
> i didn't expected such "philosophical" discussion in this thread, my 
> original intesion was to inform that devs are update their extension to 
> work proper.
> 
> Now we are at a point where decision may be difficult, and i want to 
> make a new suggestion.
> 
> The way of the function isn't consequent too:
> * there is type hinting with array but in the function there is a check 
> for !array
> * 2 parameters use type hinting, one not
> * the function also causes problems, Dmitry wrote about in his blog, 
> cache tables are filled with results of this function.
> 
> So here is my suggestion:
> * remove type hinting so function will not stop work
> * mark function as deprecated so it will be removed in 4.5
> * write a new function that makes it proper, cleaner code and better 
> cache handling, now having a better cache mechanism we should use it

This is too extreme. We do not remove functions like that.

I thought over night and I think I am ready to accept Ernesto's suggestions. It sounds like a good solution for all cases:

function foo(array $bar = null)) {
	if (!is_array($bar)) {
		$bar = array();
	}
}

Second thing is to rewrite the function. I would add another flag, which is named $noCache and by default set to true. This looks strange for a function named "...Cached" but it preserves compatibility and solves caching problem.

-- 
Dmitry Dulepov
TYPO3 Core team
My TYPO3 book: http://www.packtpub.com/typo3-extension-development/book
In the blog: http://typo3bloke.net/post-details/duplicate_content_with_realurl/




More information about the TYPO3-dev mailing list