Hi,
> But you should be aware that it worked by accident, and not because
> of design. In PHP lingo, the original standard_helpers array looks
> like array(0 => 'Partial', 1=> 'Cache', 2 => 'Form'); and the new one
> like array(0 => 'Object', 1=> 'Form', 2 => 'Cache'); When you ask
> array_merge() to merge these two arrays it overwrites original lhs
> array elements with same keys of rhs array. Get the idea? Now if you
> will substitute the overwritten array with [Cache,Form], or [Form],
> or just [], and you will get this, respectively:
> [Cache, Form, Form]
> or
> [Form, Cache, Form]
> or
> [Partial, Cache, Form] # left intact becase NO elements were
> overwritten.
That's not true. According to the PHP documentation it will only work
this way with string keys. "If, however, the arrays contain numeric
keys, the later value will not overwrite the original value, but will be
appended."
Example:
> php > echo PHP_VERSION;
> 5.2.3-0.dotdeb.0
> php > var_dump(array_merge(array('Partial', 'Cache', 'Form'),
> array('Partial','Cache', 'Form')));
> array(6) {
> [0]=>
> string(7) "Partial"
> [1]=>
> string(5) "Cache"
> [2]=>
> string(4) "Form"
> [3]=>
> string(7) "Partial"
> [4]=>
> string(5) "Cache"
> [5]=>
> string(4) "Form"
> }
> php > var_dump(array_merge(array('Partial', 'Cache', 'Form'), array('Cache',
> 'Form')));
> array(5) {
> [0]=>
> string(7) "Partial"
> [1]=>
> string(5) "Cache"
> [2]=>
> string(4) "Form"
> [3]=>
> string(5) "Cache"
> [4]=>
> string(4) "Form"
> }
> php > var_dump(array_merge(array('Partial', 'Cache', 'Form'), array('Form')));
> array(4) {
> [0]=>
> string(7) "Partial"
> [1]=>
> string(5) "Cache"
> [2]=>
> string(4) "Form"
> [3]=>
> string(4) "Form"
> }
> php > var_dump(array_merge(array('Partial', 'Cache', 'Form'), array()));
> array(3) {
> [0]=>
> string(7) "Partial"
> [1]=>
> string(5) "Cache"
> [2]=>
> string(4) "Form"
> }
So I don't think that can explain what is happening with the
standard_helper configuration option. But I can confirm it doesn't work
like documentend in the symfony book:
http://www.symfony-project.com/book/trunk/18-Performance#Restricting%20the%20Default%20Helpers
Unfortunately I don't have time to do more debugging at the moment.
Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---