Skip to content

Commit

Permalink
Merge pull request #27 from jhedstrom/fix-drupal8-bootstrap
Browse files Browse the repository at this point in the history
Drupal 8 has removed drupal_bootstrap().

Signed-off-by: Jonathan Hedstrom <[email protected]>
  • Loading branch information
jhedstrom committed Mar 18, 2015
1 parent 50589e6 commit 3fd2b73
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Drupal/Driver/Cores/Drupal8.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
namespace Drupal\Driver\Cores;

use Drupal\Component\Utility\Random;
use Drupal\Core\DrupalKernel;
use Drupal\Driver\Exception\BootstrapException;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\node\Entity\Node;
use Drupal\node\NodeInterface;
use Drupal\taxonomy\Entity\Term;
use Symfony\Component\HttpFoundation\Request;

/**
* Drupal 8 core.
Expand All @@ -26,10 +28,14 @@ public function bootstrap() {
// Bootstrap Drupal.
$current_path = getcwd();
chdir(DRUPAL_ROOT);
require_once DRUPAL_ROOT . '/core/vendor/autoload.php';
require_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
$this->validateDrupalSite();

drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$request = Request::createFromGlobals();
$kernel = DrupalKernel::createFromRequest($request, \ComposerAutoloaderInitDrupal8::getLoader(), 'prod');
$kernel->boot();
$kernel->prepareLegacyRequest($request);

// Initialise an anonymous session. required for the bootstrap.
\Drupal::service('session_manager')->start();
Expand Down

0 comments on commit 3fd2b73

Please sign in to comment.