2017 © Pedro Peláez
 

library drupal-bootstrap

Drupal 7 bootstrap replacement

image

bangpound/drupal-bootstrap

Drupal 7 bootstrap replacement

  • Sunday, December 7, 2014
  • by bangpound
  • Repository
  • 0 Watchers
  • 0 Stars
  • 230 Installations
  • 1 Dependents
  • 2 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

Drupal 7 Bootstrap

This library serves to replace Drupal 7's bootstrap in a manner that can be overridden., (*1)

Usage

To use this, you must patch Drupal 7 core in a few places places., (*2)

In each front controller (index.php, cron.php, authorize.php, install.php, update.php, and xmlrpc.php), you must include the Composer autoloader., (*3)

After, (*4)

define('DRUPAL_ROOT', getcwd());

add:, (*5)

require_once DRUPAL_ROOT .'/../vendor/autoload.php';

For Drush to work, you must add drushrc.php to sites/all/drush:, (*6)

<?php

// Autoloading for Drush from the Drupal root's composer.json and vendor directory.
require __DIR__ . '/../../../vendor/autoload.php';

Apply the included drupal_bootstrap.patch to your Drupal root directory. The patch is included below., (*7)

diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 9f37dfc..28566ea 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -2202,11 +2202,26 @@ function drupal_anonymous_user() {
  * @param boolean $new_phase
  *   A boolean, set to FALSE if calling drupal_bootstrap from inside a
  *   function called from drupal_bootstrap (recursion).
+ * @param Drupal\Core\BootstrapInterface $object
+ *   Drupal Bootstrap object.
  *
  * @return int
  *   The most recently completed phase.
  */
-function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
+function drupal_bootstrap($phase = NULL, $new_phase = TRUE, \Drupal\Core\BootstrapInterface $object = NULL) {
+
+  /** @var \Drupal\Core\BootstrapInterface $bootstrap */
+  static $bootstrap = NULL;
+
+  // On the first call, bootstrap object does not exist yet.
+  if (!isset($bootstrap)) {
+    if (!isset($object)) {
+      // If no bootstrap object is injected, use default bootstrap.
+      $object = new \Drupal\Core\Bootstrap();
+    }
+    $bootstrap = $object;
+  }
+
   // Not drupal_static(), because does not depend on any run-time information.
   static $phases = array(
     DRUPAL_BOOTSTRAP_CONFIGURATION,
@@ -2243,41 +2258,7 @@ function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
         $stored_phase = $current_phase;
       }

-      switch ($current_phase) {
-        case DRUPAL_BOOTSTRAP_CONFIGURATION:
-          _drupal_bootstrap_configuration();
-          break;
-
-        case DRUPAL_BOOTSTRAP_PAGE_CACHE:
-          _drupal_bootstrap_page_cache();
-          break;
-
-        case DRUPAL_BOOTSTRAP_DATABASE:
-          _drupal_bootstrap_database();
-          break;
-
-        case DRUPAL_BOOTSTRAP_VARIABLES:
-          _drupal_bootstrap_variables();
-          break;
-
-        case DRUPAL_BOOTSTRAP_SESSION:
-          require_once DRUPAL_ROOT . '/' . variable_get('session_inc', 'includes/session.inc');
-          drupal_session_initialize();
-          break;
-
-        case DRUPAL_BOOTSTRAP_PAGE_HEADER:
-          _drupal_bootstrap_page_header();
-          break;
-
-        case DRUPAL_BOOTSTRAP_LANGUAGE:
-          drupal_language_initialize();
-          break;
-
-        case DRUPAL_BOOTSTRAP_FULL:
-          require_once DRUPAL_ROOT . '/includes/common.inc';
-          _drupal_bootstrap_full();
-          break;
-      }
+      $bootstrap($current_phase);
     }
   }
   return $stored_phase;

The Versions

07/12 2014

dev-master

9999999-dev

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

07/12 2014

1.3.0

1.3.0.0

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

07/12 2014

dev-develop

dev-develop

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

16/11 2014

1.2.0

1.2.0.0

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

06/10 2014

1.2.0-alpha.1

1.2.0.0-alpha1

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

02/04 2014

1.1.3

1.1.3.0

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

02/04 2014

1.1.2

1.1.2.0

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

30/03 2014

1.1.1

1.1.1.0

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

30/03 2014

1.1.0

1.1.0.0

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

26/03 2014

1.0.4

1.0.4.0

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

23/01 2014

1.0.3

1.0.3.0

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

22/01 2014

1.0.2

1.0.2.0

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

22/01 2014

1.0.1

1.0.1.0

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

22/01 2014

1.0.0

1.0.0.0

Drupal 7 bootstrap replacement

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires