=== modified file 'includes/bootstrap.inc' --- includes/bootstrap.inc +++ includes/bootstrap.inc @@ -477,7 +477,12 @@ function drupal_load($type, $name) { $filename = drupal_get_filename($type, $name); if ($filename) { - include_once "./$filename"; + if (!variable_get('split_mode', 0) || $type != 'module') { + include_once "./$filename"; + } + else { + include_once './'. variable_get('split_dir', 'split') ."/$name.module"; + } $files[$type][$name] = TRUE; return TRUE; @@ -564,7 +569,7 @@ function drupal_get_title() { if (!isset($title)) { // during a bootstrap, menu.inc is not included and thus we cannot provide a title - if (function_exists('menu_get_active_title')) { + if (!drupal_bootstrap()) { $title = check_plain(menu_get_active_title()); } } @@ -829,10 +834,17 @@ function drupal_is_denied($type, $mask) * the variable system and try to serve a page from the cache. * DRUPAL_BOOTSTRAP_FULL: Drupal is fully loaded, validate and fix input * data. + * + * @return + * If no phase is given, the array of remaining phases is returned. */ -function drupal_bootstrap($phase) { +function drupal_bootstrap($phase = NULL) { static $phases = array(DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_PAGE_CACHE, DRUPAL_BOOTSTRAP_FULL); + if (!isset($phase)) { + return $phases; + } + while (!is_null($current_phase = array_shift($phases))) { _drupal_bootstrap($current_phase); if ($phase == $current_phase) { @@ -861,14 +873,20 @@ function _drupal_bootstrap($phase) { break; case DRUPAL_BOOTSTRAP_PAGE_CACHE: - require_once './includes/module.inc'; + if (variable_get('split_mode', 0)) { + include_once('./'. variable_get('split_dir', 'split') .'/split.inc'); + } + else { + require_once './includes/module.inc'; + } + // Start a page timer: timer_start('page'); // deny access to hosts which were banned. t() is not yet available. if (drupal_is_denied('host', $_SERVER['REMOTE_ADDR'])) { header('HTTP/1.0 403 Forbidden'); - print 'Sorry, '. $_SERVER['REMOTE_ADDR']. ' has been banned.'; + print 'Sorry, '. $_SERVER['REMOTE_ADDR'] .' has been banned.'; exit(); } @@ -878,7 +896,9 @@ function _drupal_bootstrap($phase) { break; case DRUPAL_BOOTSTRAP_FULL: - require_once './includes/common.inc'; + if (!variable_get('split_mode', 0)) { + require_once './includes/common.inc'; + } _drupal_bootstrap_full(); break; } === modified file 'includes/common.inc' --- includes/common.inc +++ includes/common.inc @@ -556,11 +556,11 @@ function message_na() { function locale_initialize() { global $user; - if (function_exists('i18n_get_lang')) { + if (module_exist('i18n')) { return i18n_get_lang(); } - if (function_exists('locale')) { + if (module_exist('locale')) { $languages = locale_supported_languages(); $languages = $languages['name']; } @@ -603,7 +603,7 @@ function locale_initialize() { */ function t($string, $args = 0) { global $locale; - if (function_exists('locale') && $locale != 'en') { + if (module_exist('locale') && $locale != 'en') { $string = locale($string); } @@ -831,7 +831,7 @@ function format_plural($count, $singular if ($count == 1) return t($singular, array("%count" => $count)); // get the plural index through the gettext formula - $index = (function_exists('locale_get_plural')) ? locale_get_plural($count) : -1; + $index = module_exist('locale') ? locale_get_plural($count) : -1; if ($index < 0) { // backward compatibility return t($plural, array("%count" => $count)); } @@ -1343,14 +1343,15 @@ function _drupal_bootstrap_full() { return; } $called = 1; - require_once './includes/theme.inc'; - require_once './includes/pager.inc'; - require_once './includes/menu.inc'; - require_once './includes/tablesort.inc'; - require_once './includes/file.inc'; - require_once './includes/unicode.inc'; - require_once './includes/image.inc'; - require_once './includes/form.inc'; + $prefix = variable_get('split_mode', 0) ? variable_get('split_dir', 'split') : 'includes'; + require_once "./$prefix/theme.inc"; + require_once "./$prefix/pager.inc"; + require_once "./$prefix/menu.inc"; + require_once "./$prefix/tablesort.inc"; + require_once "./$prefix/file.inc"; + require_once "./$prefix/unicode.inc"; + require_once "./$prefix/image.inc"; + require_once "./$prefix/form.inc"; // Set the Drupal custom error handler. set_error_handler('error_handler'); // Emit the correct charset HTTP header. === modified file 'includes/module.inc' --- includes/module.inc +++ includes/module.inc @@ -118,7 +118,7 @@ function module_exist($module) { * implemented in that module. */ function module_hook($module, $hook) { - return function_exists($module .'_'. $hook); + return module_exist($module) && function_exists($module .'_'. $hook); } /** === modified file 'modules/node.module' --- modules/node.module +++ modules/node.module @@ -1883,7 +1883,7 @@ function node_delete($nid) { cache_clear_all(); // Remove this node from the search index if needed. - if (function_exists('search_wipe')) { + if (module_exist('search')) { search_wipe($node->nid, 'node'); } drupal_set_message(t('%title has been deleted.', array('%title' => theme('placeholder', $node->title)))); === modified file 'modules/system.module' --- modules/system.module +++ modules/system.module @@ -860,7 +860,11 @@ function system_modules() { drupal_get_filename('module', $file->name, $file->filename); drupal_load('module', $file->name); - $file->description = module_invoke($file->name, 'help', 'admin/modules#description'); + // can't use module_invoke here because of split + $function = $file->name .'_help'; + if (function_exists($function)) { + $file->description = $function('admin/modules#description'); + } $form['name'][$file->name] = array('#value' => $file->name); $form['description'][$file->name] = array('#value' => $file->description); === modified file 'modules/user.module' --- modules/user.module +++ modules/user.module @@ -1284,7 +1284,7 @@ function user_edit($category = 'account' drupal_goto("user/$account->uid/delete"); } - $form = _user_forms($edit, $account, $category); + $form = _user_forms($edit, $account, $category, 'form'); $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'), '#weight' => 30); if (user_access('administer users')) { $form['delete'] = array('#type' => 'submit', '#value' => t('Delete'), '#weight' => 31); @@ -1900,7 +1900,7 @@ function _user_sort($a, $b) { /** * Retrieve a list of all form elements for the specified category. */ -function _user_forms(&$edit, $account, $category, $hook = 'form') { +function _user_forms(&$edit, $account, $category, $hook) { $groups = array(); foreach (module_list() as $module) { if ($data = module_invoke($module, 'user', $hook, $edit, $account, $category)) {