src/phpDocumentor/Configuration/ServiceProvider.php
public function register(Application $app)
    {
        $this->addMerger($app);

        $app->extend(
            'console',
            function (ConsoleApplication $console) {
                $console->getDefinition()->addOption(
                    new InputOption(
                        'config',
                        'c',
                        InputOption::VALUE_OPTIONAL,
                        'Location of a custom configuration file'
                    )
                );

                return $console;
            }
        );

        $app['config.path.template'] = __DIR__ . '/Resources/phpdoc.tpl.xml';
        $app['config.path.user'] = getcwd()
            . ((file_exists(getcwd() . '/phpdoc.xml')) ? '/phpdoc.xml' : '/phpdoc.dist.xml');
        $app['config.class'] = 'phpDocumentor\Configuration';

        $app['config'] = $app->share(
            function ($app) {
                $loader = new Loader($app['serializer'], $app['config.merger']);

                return $loader->load($app['config.path.template'], $app['config.path.user'], $app['config.class']);
            }
        );
    }
public function register(Application $app)
    {
        $this->addMerger($app);

        $app->extend(
            'console',
            function (ConsoleApplication $console) {
                $console->getDefinition()->addOption(
                    new InputOption(
                        'config',
                        'c',
                        InputOption::VALUE_OPTIONAL,
                        'Location of a custom configuration file'
                    )
                );

                return $console;
            }
        );

        $app['config.path.template'] = __DIR__ . '/Resources/phpdoc.tpl.xml';
        $app['config.path.user'] = getcwd()
            . ((file_exists(getcwd() . '/phpdoc.xml')) ? '/phpdoc.xml' : '/phpdoc.dist.xml');
        $app['config.class'] = 'phpDocumentor\Configuration';

        $app['config'] = $app->share(
            function ($app) {
                $loader = new Loader($app['serializer'], $app['config.merger']);

                return $loader->load($app['config.path.template'], $app['config.path.user'], $app['config.class']);
            }
        );
    }
public function register ( Application $ app ) { $ this -> addMerger ( $ app ) ; $ app -> extend ( 'console' , function ( ConsoleApplication $ console ) { $ console -> getDefinition ( ) -> addOption ( new InputOption ( 'config' , 'c' , InputOption :: VALUE_OPTIONAL , 'Location of a custom configuration file' ) ) ; return $ console ; } ) ; $ app [ 'config.path.template' ] = __DIR__ . '/Resources/phpdoc.tpl.xml' ; $ app [ 'config.path.user' ] = getcwd ( ) . ( ( file_exists ( getcwd ( ) . '/phpdoc.xml' ) ) ? '/phpdoc.xml' : '/phpdoc.dist.xml' ) ; $ app [ 'config.class' ] = 'phpDocumentor\Configuration' ; $ app [ 'config' ] = $ app -> share ( function ( $ app ) { $ loader = new Loader ( $ app [ 'serializer' ] , $ app [ 'config.merger' ] ) ; return $ loader -> load ( $ app [ 'config.path.template' ] , $ app [ 'config.path.user' ] , $ app [ 'config.class' ] ) ; } ) ; }
Adds the Configuration object to the DIC.

phpDocumentor first loads the template config file (/data/phpdoc.tpl.xml)
and then the phpdoc.dist.xml, or the phpdoc.xml if it exists but not both,
from the current working directory.

The user config file (either phpdoc.dist.xml or phpdoc.xml) is merged
with the template file.

@param Application $app An Application instance
Adds the Configuration object to the DIC .