user->isAdmin()) { throw new Forbidden(); } } public function postActionRebuild(): bool { $this->dataManager->rebuild(); return true; } public function postActionClearCache(): bool { $this->dataManager->clearCache(); return true; } /** * @return string[] */ public function getActionJobs(): array { return $this->scheduledJob->getAvailableList(); } /** * @param array $params * @param string $data * @return array{ * id: string, * version: string, * } * @throws Forbidden * @throws Error * @todo Use Request. */ public function postActionUploadUpgradePackage($params, $data): array { if ($this->config->get('restrictedMode')) { if (!$this->user->isSuperAdmin()) { throw new Forbidden(); } } $upgradeManager = new UpgradeManager($this->container); $upgradeId = $upgradeManager->upload($data); $manifest = $upgradeManager->getManifest(); return [ 'id' => $upgradeId, 'version' => $manifest['version'], ]; } /** * @throws Forbidden * @throws Error */ public function postActionRunUpgrade(Request $request): bool { $data = $request->getParsedBody(); if ($this->config->get('restrictedMode')) { if (!$this->user->isSuperAdmin()) { throw new Forbidden(); } } $upgradeManager = new UpgradeManager($this->container); $upgradeManager->install(get_object_vars($data)); return true; } /** * @return array{ * message: string, * command: string, * } */ public function actionCronMessage(): array { return $this->scheduledJob->getSetupMessage(); } /** * @return array */ public function actionAdminNotificationList(): array { return $this->adminNotificationManager->getNotificationList(); } /** * @return array{ * php: array>, * database: array>, * permission: array>, * } */ public function actionSystemRequirementList(): array { return $this->systemRequirements->getAllRequiredList(); } }