? files ? split.patch ? split.php ? split_1.patch ? sites/localhost Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.70 diff -u -F^f -r1.70 bootstrap.inc --- includes/bootstrap.inc 22 Oct 2005 15:14:46 -0000 1.70 +++ includes/bootstrap.inc 29 Oct 2005 23:16:22 -0000 @@ -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('file_directory_path', 'files') ."/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('file_directory_path', 'files') .'/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; } Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.491 diff -u -F^f -r1.491 common.inc --- includes/common.inc 28 Oct 2005 01:06:36 -0000 1.491 +++ includes/common.inc 29 Oct 2005 23:16:23 -0000 @@ -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,16 @@ 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('file_directory_path', 'files') .'/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"; + require_once "./$prefix/legacy.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.69 diff -u -F^f -r1.69 module.inc --- includes/module.inc 25 Aug 2005 21:14:16 -0000 1.69 +++ includes/module.inc 29 Oct 2005 23:16:23 -0000 @@ -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); } /** Index: modules/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node.module,v retrieving revision 1.543 diff -u -F^f -r1.543 node.module --- modules/node.module 28 Oct 2005 14:04:20 -0000 1.543 +++ modules/node.module 29 Oct 2005 23:16:25 -0000 @@ -1874,7 +1874,7 @@ function node_delete_confirm_execute() { 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'); } Index: modules/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system.module,v retrieving revision 1.247 diff -u -F^f -r1.247 system.module --- modules/system.module 26 Oct 2005 01:24:09 -0000 1.247 +++ modules/system.module 29 Oct 2005 23:16:26 -0000 @@ -842,7 +842,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.524 diff -u -F^f -r1.524 user.module --- modules/user.module 28 Oct 2005 00:37:06 -0000 1.524 +++ modules/user.module 29 Oct 2005 23:16:27 -0000 @@ -1275,7 +1275,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); @@ -1913,7 +1913,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)) {