Hi all,
While discussing the bundles branch, Seldaek raised a valid question.
Throughout the framework, we have several list of things with precedence
rules.
For instance, the routing system uses a "first match wins" rule for its
routes (the first defined route wins over ones defined after it).
The same goes for the autoloading system. As soon Symfony2 finds a
matching class, it returns it.
But for bundles, I used the opposite rule, "last overrides previous":
public function registerBundles()
{
return array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
// ...
new Sensio\Bundle\BlogBundle\BlogBundle(),
new FooBar\Bundle\FooBlogBundle\FooBlogBundle(),
);
}
In the above example, the FooBlogBundle overrides the BlogBundle because
it's defined after.
These three examples and their associated rules are not the same but
they all seem logical to me. But Seldaek pointed that we should use the
same rule everywhere.
I think we don't want to change the rule for the routing system and the
autoloader, as the short-circuit rule has a much better performance. But
for the bundles order, either rule is possible, with no performance impact.
I think it make sense to keep the current rule for bundle ordering as it
seems more semantically correct... but I might be wrong of course.
What do you think?
Fabien
--
Fabien Potencier
Sensio CEO - symfony lead developer
sensiolabs.com | symfony-project.org | fabien.potencier.org
Tél: +33 1 40 99 80 80
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
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