appConfig = new AppConfig($appName); $this->crypt = new Crypt($this->appConfig); // Default script and style if configured $eventDispatcher = \OC::$server->getEventDispatcher(); $eventDispatcher->addListener("OCA\Files::loadAdditionalScripts", function() { if (!empty($this->appConfig->GetDocumentServerUrl())) { Util::addScript("onlyoffice", "main"); Util::addStyle("onlyoffice", "main"); } }); require_once __DIR__ . "/../3rdparty/jwt/BeforeValidException.php"; require_once __DIR__ . "/../3rdparty/jwt/ExpiredException.php"; require_once __DIR__ . "/../3rdparty/jwt/SignatureInvalidException.php"; require_once __DIR__ . "/../3rdparty/jwt/JWT.php"; $container = $this->getContainer(); $container->registerService("L10N", function($c) { return $c->query("ServerContainer")->getL10N($c->query("AppName")); }); $container->registerService("RootStorage", function($c) { return $c->query("ServerContainer")->getRootFolder(); }); $container->registerService("UserSession", function($c) { return $c->query("ServerContainer")->getUserSession(); }); $container->registerService("Logger", function($c) { return $c->query("ServerContainer")->getLogger(); }); $container->registerService("URLGenerator", function($c) { return $c->query("ServerContainer")->getURLGenerator(); }); // Controllers $container->registerService("SettingsController", function($c) { return new SettingsController( $c->query("AppName"), $c->query("Request"), $c->query("URLGenerator"), $c->query("L10N"), $c->query("Logger"), $this->appConfig, $this->crypt ); }); $container->registerService("EditorController", function($c) { return new EditorController( $c->query("AppName"), $c->query("Request"), $c->query("RootStorage"), $c->query("UserSession"), $c->query("URLGenerator"), $c->query("L10N"), $c->query("Logger"), $this->appConfig, $this->crypt ); }); $container->registerService("CallbackController", function($c) { return new CallbackController( $c->query("AppName"), $c->query("Request"), $c->query("RootStorage"), $c->query("UserSession"), $c->query("ServerContainer")->getUserManager(), $c->query("L10N"), $c->query("Logger"), $this->appConfig, $this->crypt ); }); } }