[TYPO3-core] RFC: Remove database.sql and replace its functionality dynamically

Michael Stucki michael at typo3.org
Thu Dec 29 21:35:01 CET 2005


Hi Franz,

> >-                        reset($sFiles);
> >+                        foreach ($sFiles as $f)    {
>
> Is reset not needed here?

reset + while = working on the array directly
foreach = includes reset, works on a copy of the array

In such simple cases, it's just easier to use and therefore should be 
preferred. However, over large arrays, I still recommend the reset + while 
method.

> chr(10).chr(10).chr(10).chr(10).t3lib_div::getUrl($loadedExtConf["ext_table
>s_static+adt.sql"]);
>
> use '' instead of ""

Can do that later but usually don't include it in the patches to make reviews 
easier
>
> >-                            reset($statements);
> >                             $r=0;
> >-                            while(list($k,$v)=each($statements))    {
> >+                            foreach ($statements as $k=>$v)    {
>
> Why did you remove the reset?

Foreach copies the array, so the new array starts on its beginning 
automatically. For foreach, reset is not needed!

But hey, what about the feature now? I think it's a pretty easy thing. Can I 
commit?

Regards, michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20051229/234b85a8/attachment.pgp 


More information about the TYPO3-team-core mailing list