Hi!
Thanks for the reply!
On Monday, August 15, 2011 11:53:59 PM UTC+3, Christophe COEVOET wrote:
>
> The kernel need to know the bundles to be able to load the configuration,
> which is optional (a bundle may not need any special configuration) and is
> handled by the bundle code, not by the kernel.
>
These new config options could be special for the whole system, not for each
bundle.
To make it posible we can do 2 passes of reading the configuration: first to
know where to find budle and which class to load to learn how the bundle is
named and second pass same as it is now (actually it's 2 phases of
processing the config read once).
as an example:
my_bundle_name:
_autoloader: {"Test\": %kernel.root_dir%/../bundles/Test}
_bundle_class: Test\My\BundleNameBundle
_enabled: true
After first phase we know that we need to load a class for a bundle and
where (autoloader) to look for it. Than we load all bundles almost same way
as it is now.
Or maybe it could be one config option for all bundles.
Registering the autoloader according to some classes in the bundle cannot
> work. The autoloader need to be registered *before* using any class from
> the bundle as its goal is about letting PHP know where it can find the
> classes.
>
> No, no... Not registering according to some classes found (autodetection)
- bundle itself provides the autoloading rules. It could be a separate
config which each bundle has.
It's only scanning directories recursively inside common bundles dir to find
that special config.
4ex bundle.yml laying in the bundle dir or inside it's Resources/config dir
could have:
config:
autoloader: {"Test\": %bundle_dir%/}
bundle_class: Test\My\BundleNameBundle
Again this could require to load configs before the actual configuration
compilation.
What do you think?
Thanks!
Oleg.
--
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