mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Fix incorrect $database autoinit
BUG Fix missing $request in Installer bootstrapping
This commit is contained in:
parent
8078ee08f2
commit
b2f3b218a3
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user