Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / drush / drush / src / Boot / DrupalBoot8.php
index dc030260f19bffde9f0ad4a14e70b1a3d65f916d..b990da16eb72f3b6f6ba423c0cb5689135db8772 100644 (file)
@@ -112,11 +112,22 @@ class DrupalBoot8 extends DrupalBoot implements AutoloaderAwareInterface
     public function bootstrapDrupalSiteValidate()
     {
         parent::bootstrapDrupalSiteValidate();
+
+        // Normalize URI.
+        $uri = rtrim($this->uri, '/') . '/';
+        $parsed_url = parse_url($uri);
+
         // Account for users who omit the http:// prefix.
-        if (!parse_url($this->uri, PHP_URL_SCHEME)) {
+        if (empty($parsed_url['scheme'])) {
             $this->uri = 'http://' . $this->uri;
+            $parsed_url = parse_url($this->uri);
         }
-        $request = Request::create($this->uri, 'GET', [], [], [], ['SCRIPT_NAME' => '/index.php']);
+
+        $server = [
+            'SCRIPT_FILENAME' => getcwd() . '/index.php',
+            'SCRIPT_NAME' => isset($parsed_url['path']) ? $parsed_url['path'] . 'index.php' : '/index.php',
+        ];
+        $request = Request::create($this->uri, 'GET', [], [], [], $server);
         $this->setRequest($request);
         $confPath = drush_bootstrap_value('confPath', $this->confPath(true, true));
         drush_bootstrap_value('site', $request->getHttpHost());
@@ -156,8 +167,9 @@ class DrupalBoot8 extends DrupalBoot implements AutoloaderAwareInterface
         $classloader = $this->autoloader();
         $request = $this->getRequest();
         $kernel_factory = Kernels::getKernelFactory($kernel);
+        $allow_dumping = $kernel !== Kernels::UPDATE;
         /** @var \Drupal\Core\DrupalKernelInterface kernel */
-        $this->kernel = $kernel_factory($request, $classloader, 'prod');
+        $this->kernel = $kernel_factory($request, $classloader, 'prod', $allow_dumping);
         // Include Drush services in the container.
         // @see Drush\Drupal\DrupalKernel::addServiceModifier()
         $this->kernel->addServiceModifier(new DrushServiceModifier());