share(function (PhraseaApplication $app) { return (new UploadController($app)) ->setBorderManagerLocator(new LazyLocator($app, 'border-manager')) ->setDispatcher($app['dispatcher']) ->setDataboxLoggerLocator($app['phraseanet.logger']) ->setEntityManagerLocator(new LazyLocator($app, 'orm.em')) ->setFileSystemLocator(new LazyLocator($app, 'filesystem')) ->setTemporaryFileSystemLocator(new LazyLocator($app, 'temporary-filesystem')) ->setSubDefinitionSubstituerLocator(new LazyLocator($app, 'subdef.substituer')) ; }); } public function boot(Application $app) { // no-op } /** * Connect the ControllerCollection to the Silex Application * * @param Application $app A silex application * @return \Silex\ControllerCollection */ public function connect(Application $app) { $controllers = $this->createAuthenticatedCollection($app); $firewall = $this->getFirewall($app); $controllers->before(function () use ($firewall) { $firewall->requireRight(\ACL::CANADDRECORD); }); $controllers->get('/', 'controller.prod.upload:getUploadForm') ->bind('upload_form'); $controllers->get('/flash-version/', 'controller.prod.upload:getFlashUploadForm') ->bind('upload_flash_form'); $controllers->get('/html5-version/', 'controller.prod.upload:getHtml5UploadForm') ->bind('upload_html5_form'); $controllers->get('/head/', 'controller.prod.upload:getHead') ->bind('upload_head'); $controllers->post('/', 'controller.prod.upload:upload') ->bind('upload'); return $controllers; } }