share(function (SilexApplication $app) { return new Yaml(); }); $app['phraseanet.configuration.compiler'] = $app->share(function (SilexApplication $app) { return new Compiler(); }); $app['phraseanet.configuration.config-path'] = $app['root.path'] . '/config/configuration.yml'; $app['phraseanet.configuration.config-compiled-path'] = $app['root.path'] . '/tmp/configuration-compiled.php'; $app['phraseanet.configuration'] = $app->share(function (SilexApplication $app) { return new Configuration( $app['phraseanet.configuration.yaml-parser'], $app['phraseanet.configuration.compiler'], $app['phraseanet.configuration.config-path'], $app['phraseanet.configuration.config-compiled-path'], $app['debug'] ); }); } /** * {@inheritDoc} */ public function boot(SilexApplication $app) { $app['dispatcher'] = $app->share( $app->extend('dispatcher', function ($dispatcher, SilexApplication $app) { $dispatcher->addSubscriber(new TrustedProxySubscriber($app['phraseanet.configuration'])); return $dispatcher; }) ); } }