share(function(Application $app) { $mapping = array(); if (isset($app['phraseanet.configuration']['xsendfile']['mapping'])) { $mapping = $app['phraseanet.configuration']['xsendfile']['mapping']; } $mapping[] = array( 'directory' => $app['root.path'] . '/tmp/download/', 'mount-point' => '/download/', ); $mapping[] = array( 'directory' => $app['root.path'] . '/tmp/lazaret/', 'mount-point' => '/lazaret/', ); return $mapping; }); $app['phraseanet.xsendfile-mapping'] = $app->share(function($app) { return new XsendfileMapping($app['xsendfile.mapping']); }); $app['phraseanet.file-serve'] = $app->share(function (Application $app) { return ServeFileResponseFactory::create($app); }); } /** * {@inheritDoc} */ public function boot(Application $app) { $app['dispatcher']->addSubscriber(new XSendFileSubscriber($app)); } }