Permalink
Browse files

added the concept of a main DIC extension for bundles

This allows for better conventions and better error messages if you
use the wrong configuration alias in a config file.

This is also the first step for a bigger refactoring of how the configuration
works (see next commits).

 * Bundle::registerExtensions() method has been renamed to Bundle::build()

 * The "main" DIC extension must be renamed to the new convention to be
   automatically registered:

      SensioBlogBundle -> DependencyInjection\SensioBlogExtension

 * The main DIC extension alias must follow the convention:

      sensio_blog for SensioBlogBundle

 * If you have more than one extension for a bundle (which should really
   never be the case), they must be registered manually by overriding the
   build() method

 * If you use YAML or PHP for your configuration, renamed the following
   configuration entry points in your configs:

      app -> framework
      webprofiler -> web_profiler
      doctrine_odm -> doctrine_mongo_db
  • Loading branch information...
1 parent 5330d45 commit 5842458c71c9fb0d8875d885ded94402b961c17b @fabpot fabpot committed Feb 15, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 DependencyInjection/DoctrineMongoDBExtension.php
  2. +2 −2 DoctrineMongoDBBundle.php
@@ -402,6 +402,6 @@ public function getXsdValidationBasePath()
*/
public function getAlias()
{
- return 'doctrine_odm';
+ return 'doctrine_mongo_db';
}
}
@@ -27,9 +27,9 @@
*/
class DoctrineMongoDBBundle extends Bundle
{
- public function registerExtensions(ContainerBuilder $container)
+ public function build(ContainerBuilder $container)
{
- parent::registerExtensions($container);
+ parent::build($container);
$container->addCompilerPass(new RegisterEventListenersAndSubscribersPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
$container->addCompilerPass(new CreateProxyDirectoryPass(), PassConfig::TYPE_BEFORE_REMOVING);

0 comments on commit 5842458

Please sign in to comment.