*/ class InstallServices extends AbstractAction { /** * @param $params * @return common_report_Report * @throws common_Exception * @throws InvalidServiceManagerException */ public function __invoke($params) { $exceptionInterpreterService = $this->getServiceManager()->get(ExceptionInterpreterService::SERVICE_ID); $interpreters = $exceptionInterpreterService->getOption(ExceptionInterpreterService::OPTION_INTERPRETERS); $interpreters[LtiException::class] = ExceptionInterpreter::class; $exceptionInterpreterService->setOption(ExceptionInterpreterService::OPTION_INTERPRETERS, $interpreters); $this->getServiceManager()->register(ExceptionInterpreterService::SERVICE_ID, $exceptionInterpreterService); $userService = $this->getServiceManager()->get(\tao_models_classes_UserService::SERVICE_ID); $config = $userService->getOptions(); $newLtiUserService = new UserService($config); $this->getServiceManager()->register(\tao_models_classes_UserService::SERVICE_ID, $newLtiUserService); $this->createFileSystem(); return common_report_Report::createSuccess('Successfully installed'); } /** * @throws common_Exception * @throws InvalidServiceManagerException */ private function createFileSystem(): void { /** @var FileSystemService $fsService */ $fsService = $this->getServiceManager()->get(FileSystemService::SERVICE_ID); $fsService->createFileSystem(PlatformKeyChainRepository::FILE_SYSTEM_ID); $this->getServiceManager()->register(FileSystemService::SERVICE_ID, $fsService); } }