X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FInstall.php;h=1631cfe7f4b8ef83f459c09b4857b13998f189a8;hb=f114ad188353910f1714a2df04affb7e5ee58253;hp=c766dd551583cad8349e73b3daa7163232642209;hpb=7ccfbd8ef2bda9cdf8669eda2bfd9872b15b41bb;p=friendica.git diff --git a/src/Module/Install.php b/src/Module/Install.php index c766dd5515..1631cfe7f4 100644 --- a/src/Module/Install.php +++ b/src/Module/Install.php @@ -1,6 +1,6 @@ app = $app; $this->mode = $mode; - $this->baseUrl = $baseUrl; $this->installer = $installer; if (!$this->mode->isInstall()) { @@ -105,7 +104,7 @@ class Install extends BaseModule $this->currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK; } - public function post() + protected function post(array $request = []) { $configCache = $this->app->getConfigCache(); @@ -171,7 +170,7 @@ class Install extends BaseModule return; } - $this->installer->installDatabase($configCache->get('system', 'basepath')); + $this->installer->installDatabase(); // install allowed themes to register theme hooks // this is same as "Reload active theme" in /admin/themes @@ -187,7 +186,7 @@ class Install extends BaseModule } } - public function content(): string + protected function content(array $request = []): string { $configCache = $this->app->getConfigCache(); @@ -338,7 +337,7 @@ class Install extends BaseModule if (count($this->installer->getChecks()) == 0) { $txt = '
';
- $txt .= $this->t('Your Friendica site database has been installed.') . EOL;
+ $txt .= $this->t('Your Friendica site database has been installed.') . '
';
$db_return_text .= $txt;
}
@@ -364,7 +363,7 @@ class Install extends BaseModule
* @return string The text for the next steps
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- private function whatNext()
+ private function whatNext(): string
{
$baseurl = $this->baseUrl->get();
return
@@ -384,13 +383,23 @@ class Install extends BaseModule
* @param string $cat The category of the setting
* @param string $key The key of the setting
* @param null|string $default The default value
+ * @return void
*/
- private function checkSetting(Cache $configCache, array $post, $cat, $key, $default = null)
+ private function checkSetting(Cache $configCache, array $post, string $cat, string $key, ?string $default = null)
{
- $configCache->set($cat, $key,
- trim(($post[sprintf('%s-%s', $cat, $key)] ?? '') ?:
- ($default ?? $configCache->get($cat, $key))
- )
- );
+ $value = null;
+
+ if (isset($post[sprintf('%s-%s', $cat, $key)])) {
+ $value = trim($post[sprintf('%s-%s', $cat, $key)]);
+ }
+
+ if (isset($value)) {
+ $configCache->set($cat, $key, $value, Cache::SOURCE_ENV);
+ return;
+ }
+
+ if (isset($default)) {
+ $configCache->set($cat, $key, $default, Cache::SOURCE_ENV);
+ }
}
}