share(function ($app) { return XSendFileFactory::create($app); }); $app['phraseanet.file-serve'] = $app->share(function (Application $app) { return ServeFileResponseFactory::create($app); }); } /** * {@inheritDoc} */ public function boot(Application $app) { $app['dispatcher'] = $app->share( $app->extend('dispatcher', function ($dispatcher, Application $app) { $dispatcher->addSubscriber(new XSendFileSubscriber($app)); return $dispatcher; }) ); } }