Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.99 diff -u -p -r1.99 bootstrap.inc --- includes/bootstrap.inc 7 May 2006 00:08:36 -0000 1.99 +++ includes/bootstrap.inc 23 May 2006 12:41:43 -0000 @@ -484,7 +484,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; @@ -719,10 +724,16 @@ 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_PATH, DRUPAL_BOOTSTRAP_FULL); + if (!isset($phase)) { + return $phases; + } + while (!is_null($current_phase = array_shift($phases))) { _drupal_bootstrap($current_phase); if ($phase == $current_phase) { @@ -751,14 +762,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(); } @@ -774,7 +791,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; } Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.541 diff -u -p -r1.541 common.inc --- includes/common.inc 22 May 2006 20:41:16 -0000 1.541 +++ includes/common.inc 23 May 2006 12:41:45 -0000 @@ -551,11 +551,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']; } @@ -598,7 +598,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); } @@ -783,7 +783,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)); } @@ -1327,14 +1327,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. Index: includes/module.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/module.inc,v retrieving revision 1.76 diff -u -p -r1.76 module.inc --- includes/module.inc 7 May 2006 00:08:36 -0000 1.76 +++ includes/module.inc 23 May 2006 12:41:45 -0000 @@ -128,7 +128,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); } /** Index: modules/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node.module,v retrieving revision 1.650 diff -u -p -r1.650 node.module --- modules/node.module 18 May 2006 14:58:57 -0000 1.650 +++ modules/node.module 23 May 2006 12:41:49 -0000 @@ -1918,7 +1918,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)))); Index: modules/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system.module,v retrieving revision 1.327 diff -u -p -r1.327 system.module --- modules/system.module 16 May 2006 09:22:36 -0000 1.327 +++ modules/system.module 23 May 2006 12:41:51 -0000 @@ -901,7 +901,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); Index: modules/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user.module,v retrieving revision 1.624 diff -u -p -r1.624 user.module --- modules/user.module 23 May 2006 02:37:48 -0000 1.624 +++ modules/user.module 23 May 2006 12:41:54 -0000 @@ -1409,7 +1409,7 @@ function user_edit($category = 'account' drupal_goto("user/$account->uid/delete", $destination); } - $form = _user_forms($edit, $account, $category); + $form = _user_forms($edit, $account, $category, 'form'); $form['_category'] = array('#type' => 'value', '#value' => $category); $form['_account'] = array('#type' => 'value', '#value' => $account); $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'), '#weight' => 30); @@ -2087,7 +2087,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)) {