X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Fsrc%2FBoot%2FDrupalBoot8.php;fp=vendor%2Fdrush%2Fdrush%2Fsrc%2FBoot%2FDrupalBoot8.php;h=b990da16eb72f3b6f6ba423c0cb5689135db8772;hp=dc030260f19bffde9f0ad4a14e70b1a3d65f916d;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/vendor/drush/drush/src/Boot/DrupalBoot8.php b/vendor/drush/drush/src/Boot/DrupalBoot8.php index dc030260f..b990da16e 100644 --- a/vendor/drush/drush/src/Boot/DrupalBoot8.php +++ b/vendor/drush/drush/src/Boot/DrupalBoot8.php @@ -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());