Skip to content
Snippets Groups Projects
Commit f70f4f47 authored by catch's avatar catch
Browse files

Issue #2969715 by alexpott, pookmish, dawehner: Drush site-install command...

Issue #2969715 by alexpott, pookmish, dawehner: Drush site-install command doesn't work when settings.php is present
parent 2f9be00c
No related branches found
No related tags found
No related merge requests found
......@@ -424,8 +424,11 @@ function install_begin_request($class_loader, &$install_state) {
}
$GLOBALS['conf']['container_service_providers']['InstallerConfigOverride'] = 'Drupal\Core\Installer\ConfigOverride';
// Only allow dumping the container once the hash salt has been created.
$kernel = InstallerKernel::createFromRequest($request, $class_loader, $environment, (bool) Settings::get('hash_salt', FALSE));
// Only allow dumping the container once the hash salt has been created. Note,
// InstallerKernel::createFromRequest() is not used because Settings is
// already initialized.
$kernel = new InstallerKernel($environment, $class_loader, (bool) Settings::get('hash_salt', FALSE));
$kernel::bootEnvironment();
$kernel->setSitePath($site_path);
$kernel->boot();
$container = $kernel->getContainer();
......
......@@ -3,7 +3,6 @@
namespace Drupal\Core\Installer;
use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;
/**
* Extend DrupalKernel to handle force some kernel behaviors.
......@@ -67,15 +66,4 @@ public function getInstallProfile() {
return $profile;
}
/**
* {@inheritdoc}
*/
public static function createFromRequest(Request $request, $class_loader, $environment, $allow_dumping = TRUE, $app_root = NULL) {
// This override exists because we don't need to initialize the settings
// again as they already are in install_begin_request().
$kernel = new static($environment, $class_loader, $allow_dumping, $app_root);
static::bootEnvironment($app_root);
return $kernel;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment