share(function ($app) { return XSendFileFactory::create($app); }); $app['phraseanet.h264-factory'] = $app->share(function ($app) { return H264Factory::create($app); }); $app['phraseanet.h264'] = $app->share(function ($app) { return $app['phraseanet.h264-factory']->createMode(false); }); $app['phraseanet.static-file'] = $app->share(function (Application $app) { return new StaticMode($app['phraseanet.thumb-symlinker']); }); $app['phraseanet.file-serve'] = $app->share(function (Application $app) { return new ServeFileResponseFactory($app['unicode']); }); } /** * {@inheritDoc} */ public function boot(Application $app) { $app['dispatcher'] = $app->share( $app->extend('dispatcher', function (EventDispatcherInterface $dispatcher, Application $app) { $dispatcher->addSubscriber(new XSendFileSubscriber($app)); return $dispatcher; }) ); } }