diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/bootstrap.inc | 11 | ||||
-rw-r--r-- | includes/module.inc | 8 |
2 files changed, 12 insertions, 7 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 66249c534..7c3d6dae4 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -330,7 +330,7 @@ function conf_init() { $cookie_domain = substr($cookie_domain, 4); } $cookie_domain = explode(':', $cookie_domain); - $cookie_domain = '.'. array_shift($cookie_domain); + $cookie_domain = '.'. $cookie_domain[0]; // Per RFC 2109, cookie domains must contain at least one dot other than the // first. For hosts such as 'localhost' or IP Addresses we don't set a cookie domain. if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) { @@ -868,15 +868,18 @@ function drupal_anonymous_user($session = '') { * DRUPAL_BOOTSTRAP_FULL: Drupal is fully loaded, validate and fix input data. */ function drupal_bootstrap($phase) { - static $phases = array(DRUPAL_BOOTSTRAP_CONFIGURATION, DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE, DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_ACCESS, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE, DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_PATH, DRUPAL_BOOTSTRAP_FULL); + static $phases = array(DRUPAL_BOOTSTRAP_CONFIGURATION, DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE, DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_ACCESS, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE, DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_PATH, DRUPAL_BOOTSTRAP_FULL), $phase_index = 0; // Stop early if $phase was already executed. - if (!in_array($phase, $phases)) { + if ($phase < $phase_index) { return; } - while (!is_null($current_phase = array_shift($phases))) { + while (!empty($phases)) { + $current_phase = $phases[$phase_index]; + unset($phases[$phase_index]); _drupal_bootstrap($current_phase); + $phase_index++; if ($phase == $current_phase) { return; } diff --git a/includes/module.inc b/includes/module.inc index fb1b9d9b7..7edbf17a4 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -380,8 +380,9 @@ function module_implements($hook, $sort = FALSE, $refresh = FALSE) { */ function module_invoke() { $args = func_get_args(); - $module = array_shift($args); - $hook = array_shift($args); + $module = $args[0]; + $hook = $args[1]; + unset($args[0], $args[1]); $function = $module .'_'. $hook; if (module_hook($module, $hook)) { return call_user_func_array($function, $args); @@ -400,7 +401,8 @@ function module_invoke() { */ function module_invoke_all() { $args = func_get_args(); - $hook = array_shift($args); + $hook = $args[0]; + unset($args[0]); $return = array(); foreach (module_implements($hook) as $module) { $function = $module .'_'. $hook; |