diff --git a/src/Core/CoreKernel.php b/src/Core/CoreKernel.php index 5b234bbae..140d248af 100644 --- a/src/Core/CoreKernel.php +++ b/src/Core/CoreKernel.php @@ -318,7 +318,6 @@ class CoreKernel implements Kernel */ protected function getDatabaseConfig() { - /** @skipUpgrade */ $databaseConfig = [ "type" => getenv('SS_DATABASE_CLASS') ?: 'MySQLDatabase', @@ -361,7 +360,7 @@ class CoreKernel implements Kernel */ protected function getDatabasePrefix() { - return getenv('SS_DATABASE_PREFIX'); + return getenv('SS_DATABASE_PREFIX') ?: ''; } /** @@ -406,8 +405,12 @@ class CoreKernel implements Kernel $database = str_replace('.', '', basename($databaseDir)); $prefix = $this->getDatabasePrefix(); - if ($prefix === false) { + if ($prefix) { $prefix = 'SS_'; + } else { + // If no prefix, hard-code prefix into database global + $prefix = ''; + $database = 'SS_' . $database; } return $prefix . $database; diff --git a/src/Dev/Install/Installer.php b/src/Dev/Install/Installer.php index f0fe2ca82..3ee2154bb 100644 --- a/src/Dev/Install/Installer.php +++ b/src/Dev/Install/Installer.php @@ -212,7 +212,7 @@ PHP // Build db within HTTPApplication $app->execute($request, function (HTTPRequest $request) use ($config) { // Start session and execute - $request->getSession()->init(); + $request->getSession()->init($request); // Output status $this->statusMessage("Building database schema..."); @@ -242,7 +242,7 @@ PHP $request->getSession()->set('username', $config['admin']['username']); $request->getSession()->set('password', $config['admin']['password']); - $request->getSession()->save(); + $request->getSession()->save($request); }, true); // Check result of install