share(function (PhraseaApplication $app) { return (new DoDownloadController($app)) ->setDelivererLocator(new LazyLocator($app, 'phraseanet.file-serve')) ->setDispatcher($app['dispatcher']) ->setFileSystemLocator(new LazyLocator($app, 'filesystem')) ; }); } public function boot(Application $app) { // no-op } /** * {@inheritDoc} */ public function connect(Application $app) { $controllers = $this->createCollection($app); $controllers->get('/{token}/prepare/', 'controller.prod.do-download:prepareDownload') ->before($app['middleware.token.converter']) ->bind('prepare_download') ->assert('token', '[a-zA-Z0-9]{8,32}'); $controllers->match('/{token}/get/', 'controller.prod.do-download:downloadDocuments') ->before($app['middleware.token.converter']) ->bind('document_download') ->assert('token', '[a-zA-Z0-9]{8,32}'); $controllers->post('/{token}/execute/', 'controller.prod.do-download:downloadExecute') ->before($app['middleware.token.converter']) ->bind('execute_download') ->assert('token', '[a-zA-Z0-9]{8,32}'); return $controllers; } }