function bootstrap_drupal_configuration() { $this->request = Request::createFromGlobals(); $classloader = drush_drupal_load_autoloader(DRUPAL_ROOT); $this->kernel = DrupalKernel::createFromRequest($this->request, $classloader, 'prod'); // Unset drupal error handler and restore drush's one. restore_error_handler(); parent::bootstrap_drupal_configuration(); }
function bootstrap_drupal_configuration() { $this->request = Request::createFromGlobals(); $classloader = drush_drupal_load_autoloader(DRUPAL_ROOT); // @todo - use Request::create() and then no need to set PHP superglobals $kernelClass = new \ReflectionClass('\\Drupal\\Core\\DrupalKernel'); if ($kernelClass->hasMethod('addServiceModifier')) { $this->kernel = DrupalKernel::createFromRequest($this->request, $classloader, 'prod', DRUPAL_ROOT); } else { $this->kernel = DrushDrupalKernel::createFromRequest($this->request, $classloader, 'prod', DRUPAL_ROOT); } // @see Drush\Drupal\DrupalKernel::addServiceModifier() $this->kernel->addServiceModifier(new DrushServiceModfier()); // Unset drupal error handler and restore Drush's one. restore_error_handler(); // Disable automated cron if the module is enabled. $GLOBALS['config']['automated_cron.settings']['interval'] = 0; parent::bootstrap_drupal_configuration(); }