The logic for automatic loading can be seen in the base Bundle class' build() method (inside HttpKernel component). It guesses the class name for the extension based on the Bundle's own class name and namespace, checks if it exists, and throws a LogicException if its assumption of the alias name doesn't match. That's all based on the conventions.
To circumvent this, you'd just want to override the build() method in your typically-empty Bundle class and do something else, likely without invoking the parent method at all. On Thu, Feb 24, 2011 at 2:06 AM, Christian Schaefer <[email protected]>wrote: > ok makes sense. I suppose the automatic loading can only be turned off > by not following the Extension naming convention? > > > On Thu, Feb 24, 2011 at 6:53 AM, Fabien Potencier > <[email protected]> wrote: > > > > On 2/24/11 6:39 AM, Christian Schaefer wrote: > >> > >> hi, > >> > >> I just noticed that the return value of the mentioned method has to > >> follow the tight convention of being an "underscore version of the > >> bundle name" otherwise the following LogicException will be thrown: > >> > >> The extension alias for the default extension of a bundle must be > >> the underscored version of the bundle name ("one" vs "another") > >> > >> If that is the case wouldn't it be better to implement this method in > >> Symfony\Component\DependencyInjection\Extension\Extension in a generic > >> way? > > > > It is only the case for the "default" extension if you want it to be > > automatically loaded. But you can create extensions that do not follow > the > > convention if you want; you will just have to register them by hand. > > > > Conventions in Symfony2 are always optional. If you do not follow them, > you > > have more work to do on your side, but this is always possible. > > > > Fabien > > > >> > >> cheers > >> /christian > >> > > > > -- > > 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 > > > > -- > 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 > -- jeremy mikola -- 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
