share( function (PhraseaApplication $app) { return (new ProdReportController( $app['report.factory'], $app['conf']->get(['registry', 'modules', 'anonymous-report']), $app->getAclForUser($app->getAuthenticatedUser()), $app['phraseanet.appbox'] )); } ); $app['report.factory'] = $app->share( function (PhraseaApplication $app) { return (new ReportFactory( $app['conf']->get(['main', 'key']), $app['phraseanet.appbox'], $app->getAclForUser($app->getAuthenticatedUser()) )); } ); } public function boot(Application $app) { // no-op } /** * {@inheritDoc} */ public function connect(Application $app) { $controllers = $this->createAuthenticatedCollection($app); $controllers ->match('/connections/{sbasId}/', 'controller.prod.report:connectionsAction') ->assert('sbasId', '\d+') ->bind('report2_connections') ->method('GET|POST') ; $controllers ->match('/downloads/{sbasId}/', 'controller.prod.report:downloadsAction') ->assert('sbasId', '\d+') ->bind('report2_downloads') ->method('GET|POST') ; $controllers ->match('/records/{sbasId}/', 'controller.prod.report:recordsAction') ->assert('sbasId', '\d+') ->bind('report2_records') ->method('GET|POST') ; return $controllers; } }