instancesRequest = $instancesRequest; $this->configService = $configService; $this->miscService = $miscService; $this->config = $config; } public function createLocal(): Instance { $instance = new Instance(); $instance->setLocal(true) ->setVersion($this->config->getAppValue(Application::APP_ID, 'installed_version', '0.0')) ->setApprovalRequired(false) ->setDescription($this->config->getAppValue('theming', 'slogan', 'a safe home for your data')) ->setTitle($this->config->getAppValue('theming', 'name', 'Nextcloud Social')); $this->instancesRequest->save($instance); return $instance; } /** * @throws InstanceDoesNotExistException */ public function getLocal(int $format = ACore::FORMAT_LOCAL): Instance { try { return $this->instancesRequest->getLocal($format); } catch (InstanceDoesNotExistException $e) { } return $this->createLocal(); } }