Verified Commit 61e4c249 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3279192 by daffie, ravi.shankar, geek-merlin, alexpott: Change the...

Issue #3279192 by daffie, ravi.shankar, geek-merlin, alexpott: Change the method Drupal\Core\DrupalKernel::handle() to make it work for the Swoole module
parent 9a55cdc6
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@
use Drupal\Core\Cache\DatabaseBackend;
use Drupal\Core\Config\BootstrapConfigStorageFactory;
use Drupal\Core\Config\NullStorage;
use Drupal\Core\Database\Database;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceModifierInterface;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
@@ -664,18 +663,11 @@ public function handle(Request $request, $type = self::MAIN_REQUEST, $catch = TR
    static::bootEnvironment();

    try {
      if (!$this->booted) {
        $this->initializeSettings($request);

      // Redirect the user to the installation script if Drupal has not been
      // installed yet (i.e., if no $databases array has been defined in the
      // settings.php file) and we are not already installing.
      if (!Database::getConnectionInfo() && !InstallerKernel::installationAttempted() && PHP_SAPI !== 'cli') {
        $response = new RedirectResponse($request->getBasePath() . '/core/install.php', 302, ['Cache-Control' => 'no-cache']);
      }
      else {
        $this->boot();
        $response = $this->getHttpKernel()->handle($request, $type, $catch);
      }
      $response = $this->getHttpKernel()->handle($request, $type, $catch);
    }
    catch (\Exception $e) {
      if ($catch === FALSE) {
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
namespace Drupal\Core\Installer;

use Drupal\Core\Database\Connection;
use Drupal\Core\Database\ConnectionNotDefinedException;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\DatabaseException;
use Drupal\Core\Database\DatabaseNotFoundException;
@@ -51,7 +52,7 @@ protected function shouldRedirectToInstaller(\Exception $exception, Connection $
    // If the database wasn't found, assume the user hasn't entered it properly
    // and redirect to the installer. This check needs to come first because a
    // DatabaseNotFoundException is also an instance of DatabaseException.
    if ($exception instanceof DatabaseNotFoundException) {
    if ($exception instanceof DatabaseNotFoundException || $exception instanceof ConnectionNotDefinedException) {
      return TRUE;
    }