Index: cron.php =================================================================== RCS file: /cvs/drupal/drupal/cron.php,v retrieving revision 1.39 diff -u -p -r1.39 cron.php --- cron.php 26 May 2008 17:24:42 -0000 1.39 +++ cron.php 24 Aug 2008 01:04:54 -0000 @@ -6,7 +6,9 @@ * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs). */ -include_once './includes/bootstrap.inc'; +define('DRUPAL_ROOT', dirname(realpath(__FILE__))); + +include_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); if (isset($_GET['cron_key']) && variable_get('cron_key', 'drupal') == $_GET['cron_key']) { drupal_cron_run(); Index: index.php =================================================================== RCS file: /cvs/drupal/drupal/index.php,v retrieving revision 1.95 diff -u -p -r1.95 index.php --- index.php 21 Aug 2008 19:36:35 -0000 1.95 +++ index.php 24 Aug 2008 01:32:36 -0000 @@ -12,7 +12,9 @@ * See COPYRIGHT.txt and LICENSE.txt. */ -require_once './includes/bootstrap.inc'; +define('DRUPAL_ROOT', dirname(realpath(__FILE__))); + +require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); $return = menu_execute_active_handler(); Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.126 diff -u -p -r1.126 install.php --- install.php 21 Aug 2008 19:36:35 -0000 1.126 +++ install.php 24 Aug 2008 01:49:56 -0000 @@ -1,7 +1,9 @@ filename); + include_once DRUPAL_ROOT . '/' . $profile->filename; // Load profile details and store them for later retrieval. $function = $profile->name . '_profile_details'; @@ -498,8 +500,8 @@ function install_find_locales($profilena * The selected language. */ function install_select_locale($profilename) { - include_once './includes/file.inc'; - include_once './includes/form.inc'; + include_once DRUPAL_ROOT . '/includes/file.inc'; + include_once DRUPAL_ROOT . '/includes/form.inc'; // Find all available locales. $locales = install_find_locales($profilename); @@ -563,7 +565,7 @@ function install_select_locale($profilen * Form API array definition for language selection. */ function install_select_locale_form(&$form_state, $locales) { - include_once './includes/locale.inc'; + include_once DRUPAL_ROOT . '/includes/locale.inc'; $languages = _locale_get_predefined_list(); foreach ($locales as $locale) { // Try to use verbose locale name @@ -659,14 +661,14 @@ function install_tasks($profile, $task) // to the same address, until the batch finished callback is invoked // and the task advances to 'locale-initial-import'. if ($task == 'profile-install-batch') { - include_once 'includes/batch.inc'; + include_once DRUPAL_ROOT .'/includes/batch.inc'; $output = _batch_page(); } // Import interface translations for the enabled modules. if ($task == 'locale-initial-import') { if (!empty($install_locale) && ($install_locale != 'en')) { - include_once 'includes/locale.inc'; + include_once DRUPAL_ROOT . '/includes/locale.inc'; // Enable installation language as default site language. locale_add_language($install_locale, NULL, NULL, NULL, NULL, NULL, 1, TRUE); // Collect files to import for this language. @@ -685,8 +687,8 @@ function install_tasks($profile, $task) $task = 'configure'; } if ($task == 'locale-initial-batch') { - include_once 'includes/batch.inc'; - include_once 'includes/locale.inc'; + include_once DRUPAL_ROOT . '/includes/batch.inc'; + include_once DRUPAL_ROOT . '/includes/locale.inc'; $output = _batch_page(); } @@ -770,7 +772,7 @@ if (Drupal.jsEnabled) { // control and proceed with importing the remaining translations. if ($task == 'profile-finished') { if (!empty($install_locale) && ($install_locale != 'en')) { - include_once 'includes/locale.inc'; + include_once DRUPAL_ROOT . '/includes/locale.inc'; // Collect files to import for this language. Skip components // already covered in the initial batch set. $batch = locale_batch_by_language($install_locale, '_install_locale_remaining_batch_finished', variable_get('install_locale_batch_components', array())); @@ -788,8 +790,8 @@ if (Drupal.jsEnabled) { $task = 'finished'; } if ($task == 'locale-remaining-batch') { - include_once 'includes/batch.inc'; - include_once 'includes/locale.inc'; + include_once DRUPAL_ROOT . '/includes/batch.inc'; + include_once DRUPAL_ROOT . '/includes/locale.inc'; $output = _batch_page(); } Index: update.php =================================================================== RCS file: /cvs/drupal/drupal/update.php,v retrieving revision 1.255 diff -u -p -r1.255 update.php --- update.php 16 Jul 2008 21:59:24 -0000 1.255 +++ update.php 24 Aug 2008 01:04:54 -0000 @@ -1,6 +1,8 @@ uid == 1) { - include_once './includes/install.inc'; - include_once './includes/batch.inc'; + include_once DRUPAL_ROOT . '/includes/install.inc'; + include_once DRUPAL_ROOT . '/includes/batch.inc'; drupal_load_updates(); update_fix_d6_requirements(); Index: xmlrpc.php =================================================================== RCS file: /cvs/drupal/drupal/xmlrpc.php,v retrieving revision 1.15 diff -u -p -r1.15 xmlrpc.php --- xmlrpc.php 10 Dec 2005 19:26:47 -0000 1.15 +++ xmlrpc.php 24 Aug 2008 01:04:54 -0000 @@ -6,9 +6,10 @@ * PHP page for handling incoming XML-RPC requests from clients. */ -include_once './includes/bootstrap.inc'; +define('DRUPAL_ROOT', dirname(realpath(__FILE__))); +include_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); -include_once './includes/xmlrpc.inc'; -include_once './includes/xmlrpcs.inc'; +include_once DRUPAL_ROOT . '/includes/xmlrpc.inc'; +include_once DRUPAL_ROOT . '/includes/xmlrpcs.inc'; xmlrpc_server(module_invoke_all('xmlrpc')); Index: includes/batch.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/batch.inc,v retrieving revision 1.20 diff -u -p -r1.20 batch.inc --- includes/batch.inc 24 Jun 2008 21:51:02 -0000 1.20 +++ includes/batch.inc 24 Aug 2008 01:44:26 -0000 @@ -183,7 +183,7 @@ function _batch_process() { // request, we check if it requires an additional file for functions // definitions. if ($set_changed && isset($current_set['file']) && is_file($current_set['file'])) { - include_once($current_set['file']); + include_once DRUPAL_ROOT . '/' . $current_set['file']; } $task_message = ''; @@ -304,7 +304,7 @@ function _batch_finished() { if (isset($batch_set['finished'])) { // Check if the set requires an additional file for functions definitions. if (isset($batch_set['file']) && is_file($batch_set['file'])) { - include_once($batch_set['file']); + include_once DRUPAL_ROOT . '/' . $batch_set['file']; } if (function_exists($batch_set['finished'])) { $batch_set['finished']($batch_set['success'], $batch_set['results'], $batch_set['operations']); Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.220 diff -u -p -r1.220 bootstrap.inc --- includes/bootstrap.inc 21 Aug 2008 19:36:36 -0000 1.220 +++ includes/bootstrap.inc 24 Aug 2008 03:03:29 -0000 @@ -326,8 +326,8 @@ function conf_init() { global $databases, $db_prefix, $cookie_domain, $conf, $installed_profile, $update_free_access; $conf = array(); - if (file_exists('./' . conf_path() . '/settings.php')) { - include_once './' . conf_path() . '/settings.php'; + if (file_exists(DRUPAL_ROOT . '/' . conf_path() . '/settings.php')) { + include_once DRUPAL_ROOT . '/' . conf_path() . '/settings.php'; } if (isset($base_url)) { @@ -599,7 +599,7 @@ function drupal_load($type, $name) { $filename = drupal_get_filename($type, $name); if ($filename) { - include_once "./$filename"; + include_once DRUPAL_ROOT . '/' . $filename; $files[$type][$name] = TRUE; return TRUE; @@ -1012,7 +1012,7 @@ function _drupal_bootstrap($phase) { case DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE: // Allow specifying special cache handlers in settings.php, like // using memcached or files for storing cache information. - require_once variable_get('cache_inc', './includes/cache.inc'); + require_once DRUPAL_ROOT . '/' . variable_get('cache_inc', 'includes/cache.inc'); // If the page_cache_fastpath is set to TRUE in settings.php and // page_cache_fastpath (implemented in the special implementation of // cache.inc) printed the page and indicated this with a returned TRUE @@ -1025,7 +1025,7 @@ function _drupal_bootstrap($phase) { case DRUPAL_BOOTSTRAP_DATABASE: // Initialize the database system. Note that the connection // won't be initialized until it is actually requested. - require_once './includes/database/database.inc'; + require_once DRUPAL_ROOT . '/includes/database/database.inc'; // Register autoload functions so that we can access classes and interfaces. spl_autoload_register('drupal_autoload_class'); spl_autoload_register('drupal_autoload_interface'); @@ -1041,7 +1041,7 @@ function _drupal_bootstrap($phase) { break; case DRUPAL_BOOTSTRAP_SESSION: - require_once variable_get('session_inc', './includes/session.inc'); + require_once DRUPAL_ROOT . '/' . variable_get('session_inc', 'includes/session.inc'); session_set_save_handler('sess_open', 'sess_close', 'sess_read', 'sess_write', 'sess_destroy_sid', 'sess_gc'); session_start(); break; @@ -1050,7 +1050,7 @@ function _drupal_bootstrap($phase) { // Initialize configuration variables, using values from settings.php if available. $conf = variable_init(isset($conf) ? $conf : array()); // Load module handling. - require_once './includes/module.inc'; + require_once DRUPAL_ROOT . '/includes/module.inc'; $cache_mode = variable_get('cache', CACHE_DISABLED); // Get the page from the cache. $cache = $cache_mode == CACHE_DISABLED ? '' : page_get_cache(); @@ -1077,13 +1077,13 @@ function _drupal_bootstrap($phase) { break; case DRUPAL_BOOTSTRAP_PATH: - require_once './includes/path.inc'; + require_once DRUPAL_ROOT . '/includes/path.inc'; // Initialize $_GET['q'] prior to loading modules and invoking hook_init(). drupal_init_path(); break; case DRUPAL_BOOTSTRAP_FULL: - require_once './includes/common.inc'; + require_once DRUPAL_ROOT . '/includes/common.inc'; _drupal_bootstrap_full(); break; } @@ -1098,7 +1098,7 @@ function _drupal_bootstrap($phase) { * @see _drupal_maintenance_theme() */ function drupal_maintenance_theme() { - require_once './includes/theme.maintenance.inc'; + require_once DRUPAL_ROOT . '/includes/theme.maintenance.inc'; _drupal_maintenance_theme(); } @@ -1126,7 +1126,7 @@ function drupal_init_language() { $language = language_default(); } else { - include_once './includes/language.inc'; + include_once DRUPAL_ROOT . '/includes/language.inc'; $language = language_initialize(); } } @@ -1276,7 +1276,7 @@ function drupal_get_schema($table = NULL // Invoke hook_schema for all modules. foreach (module_implements('schema') as $module) { $current = module_invoke($module, 'schema'); - require_once('./includes/common.inc'); + require_once DRUPAL_ROOT . '/includes/common.inc'; if (drupal_function_exists('_drupal_initialize_schema')) { _drupal_initialize_schema($module, $current); } @@ -1348,7 +1348,7 @@ function drupal_function_exists($functio $file = db_result(db_query("SELECT filename FROM {registry} WHERE name = :name AND type = :type", array(':name' => $function, ':type' => 'function'))); if ($file) { - require_once($file); + require_once DRUPAL_ROOT . '/' . $file; $checked[$function] = function_exists($function); if ($checked[$function]) { registry_mark_code('function', $function); @@ -1396,7 +1396,7 @@ function drupal_autoload_class($class) { function _registry_check_code($type, $name) { $file = db_result(db_query("SELECT filename FROM {registry} WHERE name = :name AND type = :type", array(':name' => $name, ':type' => $type))); if ($file) { - require_once($file); + require_once DRUPAL_ROOT . '/' . $file; registry_mark_code($type, $name); return TRUE; } @@ -1436,7 +1436,7 @@ function registry_mark_code($type, $name * each function, file, and hook implementation in the database. */ function registry_rebuild() { - require_once './includes/registry.inc'; + require_once DRUPAL_ROOT . '/includes/registry.inc'; _registry_rebuild(); } @@ -1507,7 +1507,7 @@ function registry_load_path_files($retur $cache = cache_get('registry:' . $menu['path'], 'cache_registry'); if (!empty($cache->data)) { foreach(explode(';', $cache->data) as $file) { - require_once($file); + require_once DRUPAL_ROOT . '/' . $file; $file_cache_data[] = $file; } } Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.788 diff -u -p -r1.788 common.inc --- includes/common.inc 21 Aug 2008 19:36:36 -0000 1.788 +++ includes/common.inc 24 Aug 2008 01:04:54 -0000 @@ -2455,7 +2455,7 @@ function drupal_valid_token($token, $val * failed. See xmlrpc_error(). */ function xmlrpc($url) { - require_once './includes/xmlrpc.inc'; + require_once DRUPAL_ROOT . '/includes/xmlrpc.inc'; $args = func_get_args(); return call_user_func_array('_xmlrpc', $args); } @@ -2467,16 +2467,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'; - require_once './includes/mail.inc'; - require_once './includes/actions.inc'; + require_once DRUPAL_ROOT . '/includes/theme.inc'; + require_once DRUPAL_ROOT . '/includes/pager.inc'; + require_once DRUPAL_ROOT . '/includes/menu.inc'; + require_once DRUPAL_ROOT . '/includes/tablesort.inc'; + require_once DRUPAL_ROOT . '/includes/file.inc'; + require_once DRUPAL_ROOT . '/includes/unicode.inc'; + require_once DRUPAL_ROOT . '/includes/image.inc'; + require_once DRUPAL_ROOT . '/includes/form.inc'; + require_once DRUPAL_ROOT . '/includes/mail.inc'; + require_once DRUPAL_ROOT . '/includes/actions.inc'; // Set the Drupal custom error handler. set_error_handler('drupal_error_handler'); // Emit the correct charset HTTP header. Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.281 diff -u -p -r1.281 form.inc --- includes/form.inc 17 Aug 2008 11:08:23 -0000 1.281 +++ includes/form.inc 24 Aug 2008 01:04:57 -0000 @@ -2499,7 +2499,7 @@ function batch_process($redirect = NULL, else { // Non-progressive execution: bypass the whole progressbar workflow // and execute the batch in one pass. - require_once './includes/batch.inc'; + require_once DRUPAL_ROOT . '/includes/batch.inc'; _batch_process(); } } Index: includes/install.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/install.inc,v retrieving revision 1.65 diff -u -p -r1.65 install.inc --- includes/install.inc 22 Aug 2008 12:43:53 -0000 1.65 +++ includes/install.inc 24 Aug 2008 02:44:23 -0000 @@ -213,9 +213,9 @@ function drupal_detect_database_types() // without modifying the installer. // Because we have no registry yet, we need to also include the install.inc // file for the driver explicitly. - foreach (glob('./includes/database/*/{install,database}.inc', GLOB_BRACE) as $file) { - include_once($file); - $drivers[max(explode('/', $file, -1))] = $file; + foreach (glob(DRUPAL_ROOT . '/includes/database/*/{install,database}.inc', GLOB_BRACE) as $file) { + include_once $file; + $drivers[end(explode('/', $file, -1))] = $file; } foreach ($drivers as $driver => $file) { @@ -325,8 +325,8 @@ abstract class DatabaseInstaller { * An array of settings that need to be updated. */ function drupal_rewrite_settings($settings = array(), $prefix = '') { - $default_settings = './sites/default/default.settings.php'; - $settings_file = './' . conf_path(FALSE, TRUE) . '/' . $prefix . 'settings.php'; + $default_settings = 'sites/default/default.settings.php'; + $settings_file = conf_path(FALSE, TRUE) . '/' . $prefix . 'settings.php'; // Build list of setting names and insert the values into the global namespace. $keys = array(); @@ -337,7 +337,7 @@ function drupal_rewrite_settings($settin $buffer = NULL; $first = TRUE; - if ($fp = fopen($default_settings, 'r')) { + if ($fp = fopen(DRUPAL_ROOT . '/' . $default_settings, 'r')) { // Step line by line through settings.php. while (!feof($fp)) { $line = fgets($fp); @@ -385,7 +385,7 @@ function drupal_rewrite_settings($settin } } - $fp = fopen($settings_file, 'w'); + $fp = fopen(DRUPAL_ROOT . '/' . $settings_file, 'w'); if ($fp && fwrite($fp, $buffer) === FALSE) { drupal_set_message(st('Failed to modify %settings, please verify the file permissions.', array('%settings' => $settings_file)), 'error'); } @@ -420,16 +420,16 @@ function drupal_get_install_files($modul * The list of modules to install. */ function drupal_verify_profile($profile, $locale) { - include_once './includes/file.inc'; - include_once './includes/common.inc'; + include_once DRUPAL_ROOT . '/includes/file.inc'; + include_once DRUPAL_ROOT . '/includes/common.inc'; - $profile_file = "./profiles/$profile/$profile.profile"; + $profile_file = DRUPAL_ROOT . "/profiles/$profile/$profile.profile"; if (!isset($profile) || !file_exists($profile_file)) { install_no_profile_error(); } - require_once($profile_file); + require_once $profile_file; // Get a list of modules required by this profile. $function = $profile . '_profile_modules'; @@ -512,11 +512,11 @@ function drupal_install_init_database() if (!$included) { $connection_info = Database::getConnectionInfo(); $driver = $connection_info['default']['driver']; - require_once('./includes/database/query.inc'); - require_once('./includes/database/select.inc'); - require_once('./includes/database/schema.inc'); - foreach (glob('./includes/database/' . $driver . '/*.inc') as $include_file) { - require_once($include_file); + require_once DRUPAL_ROOT . '/includes/database/query.inc'; + require_once DRUPAL_ROOT . '/includes/database/select.inc'; + require_once DRUPAL_ROOT . '/includes/database/schema.inc'; + foreach (glob(DRUPAL_ROOT . '/includes/database/' . $driver . '/*.inc') as $include_file) { + require_once $include_file; } } } @@ -529,7 +529,7 @@ function drupal_install_init_database() */ function drupal_install_system() { $system_path = dirname(drupal_get_filename('module', 'system', NULL)); - require_once './' . $system_path . '/system.install'; + require_once DRUPAL_ROOT . '/' . $system_path . '/system.install'; drupal_install_init_database(); module_invoke('system', 'install'); @@ -807,16 +807,16 @@ function st($string, $args = array()) { if (!isset($locale_strings)) { $locale_strings = array(); - $filename = './profiles/' . $profile . '/translations/' . $install_locale . '.po'; - if (file_exists($filename)) { - require_once './includes/locale.inc'; + $filename = 'profiles/' . $profile . '/translations/' . $install_locale . '.po'; + if (file_exists(DRUPAL_ROOT . '/' . $filename)) { + require_once DRUPAL_ROOT . '/includes/locale.inc'; $file = (object) array('filepath' => $filename); _locale_import_read_po('mem-store', $file); $locale_strings = _locale_import_one_string('mem-report'); } } - require_once './includes/theme.inc'; + require_once DRUPAL_ROOT . '/includes/theme.inc'; // Transform arguments before inserting them foreach ($args as $key => $value) { switch ($key[0]) { @@ -843,15 +843,15 @@ function st($string, $args = array()) { * Name of profile to check. */ function drupal_check_profile($profile) { - include_once './includes/file.inc'; + include_once DRUPAL_ROOT . '/includes/file.inc'; - $profile_file = "./profiles/$profile/$profile.profile"; + $profile_file = DRUPAL_ROOT . "/profiles/$profile/$profile.profile"; if (!isset($profile) || !file_exists($profile_file)) { install_no_profile_error(); } - require_once($profile_file); + require_once $profile_file; // Get a list of modules required by this profile. $function = $profile . '_profile_modules'; @@ -863,7 +863,7 @@ function drupal_check_profile($profile) // Collect requirement testing results $requirements = array(); foreach ($installs as $install) { - require_once $install->filename; + require_once DRUPAL_ROOT . '/' . $install->filename; $function = $install->name. '_requirements'; if (function_exists($function)) { $requirements = array_merge($requirements, $function('install')); @@ -892,7 +892,7 @@ function drupal_check_module($module) { // Include install file $install = drupal_get_install_files(array($module)); if (isset($install[$module])) { - require_once $install[$module]->filename; + require_once DRUPAL_ROOT . '/' . $install[$module]->filename; // Check requirements $requirements = module_invoke($module, 'requirements', 'install'); Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.180 diff -u -p -r1.180 locale.inc --- includes/locale.inc 21 Aug 2008 19:36:36 -0000 1.180 +++ includes/locale.inc 24 Aug 2008 02:43:38 -0000 @@ -1039,7 +1039,7 @@ function _locale_import_po($file, $langc */ function _locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group = 'default') { - $fd = fopen($file->filepath, "rb"); // File will get closed by PHP on return + $fd = fopen(DRUPAL_ROOT . '/' . $file->filepath, "rb"); // File will get closed by PHP on return if (!$fd) { _locale_import_message('The translation import failed, because the file %filename could not be read.', $file); return FALSE; @@ -2542,7 +2542,7 @@ function _locale_batch_build($files, $fi 'title' => $t('Importing interface translations'), 'init_message' => $t('Starting import'), 'error_message' => $t('Error importing interface translations'), - 'file' => './includes/locale.inc', + 'file' => 'includes/locale.inc', // This is not a batch API construct, but data passed along to the // installer, so we know what did we import already. '#components' => $components, Index: includes/mail.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/mail.inc,v retrieving revision 1.14 diff -u -p -r1.14 mail.inc --- includes/mail.inc 19 May 2008 19:25:24 -0000 1.14 +++ includes/mail.inc 24 Aug 2008 01:04:57 -0000 @@ -173,7 +173,7 @@ function drupal_mail($module, $key, $to, function drupal_mail_send($message) { // Allow for a custom mail backend. if (variable_get('smtp_library', '') && file_exists(variable_get('smtp_library', ''))) { - include_once './' . variable_get('smtp_library', ''); + include_once DRUPAL_ROOT . '/' . variable_get('smtp_library', ''); return drupal_mail_wrapper($message); } else { Index: includes/menu.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/menu.inc,v retrieving revision 1.284 diff -u -p -r1.284 menu.inc --- includes/menu.inc 22 Aug 2008 12:46:24 -0000 1.284 +++ includes/menu.inc 24 Aug 2008 01:30:56 -0000 @@ -2461,7 +2461,7 @@ function _menu_site_is_offline() { return $_GET['q'] != 'user' && $_GET['q'] != 'user/login'; } // Logged in users are unprivileged here, so they are logged out. - require_once drupal_get_path('module', 'user') . '/user.pages.inc'; + require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.pages.inc'; user_logout(); } } Index: includes/module.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/module.inc,v retrieving revision 1.124 diff -u -p -r1.124 module.inc --- includes/module.inc 21 Aug 2008 19:36:36 -0000 1.124 +++ includes/module.inc 24 Aug 2008 01:30:11 -0000 @@ -220,7 +220,7 @@ function module_exists($module) { */ function module_load_install($module) { // Make sure the installation API is available - include_once './includes/install.inc'; + include_once DRUPAL_ROOT . '/includes/install.inc'; module_load_include('install', $module); } @@ -241,16 +241,13 @@ function module_load_include($type, $mod } if (drupal_function_exists('drupal_get_path')) { - $file = './' . drupal_get_path('module', $module) . "/$name.$type"; - } - - if (is_file($file)) { - require_once $file; - return $file; - } - else { - return FALSE; + $file = DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "/$name.$type"; + if (is_file($file)) { + require_once $file; + return $file; + } } + return FALSE; } /** Index: includes/registry.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/registry.inc,v retrieving revision 1.3 diff -u -p -r1.3 registry.inc --- includes/registry.inc 21 Aug 2008 19:36:36 -0000 1.3 +++ includes/registry.inc 24 Aug 2008 02:39:44 -0000 @@ -33,9 +33,9 @@ function _registry_rebuild() { // registry rebuild process runs. $connection_info = Database::getConnectionInfo(); $driver = $connection_info['default']['driver']; - require_once('./includes/database/query.inc'); - require_once('./includes/database/select.inc'); - require_once('./includes/database/' . $driver . '/query.inc'); + require_once DRUPAL_ROOT . '/includes/database/query.inc'; + require_once DRUPAL_ROOT . '/includes/database/select.inc'; + require_once DRUPAL_ROOT . '/includes/database/' . $driver . '/query.inc'; // Reset the resources cache. _registry_get_resource_name(); @@ -45,12 +45,12 @@ function _registry_rebuild() { if ($module->status) { $dir = dirname($module->filename); foreach ($module->info['files'] as $file) { - $files["./$dir/$file"] = array(); + $files["$dir/$file"] = array(); } } } foreach (file_scan_directory('includes', '\.inc$') as $filename => $file) { - $files["./$filename"] = array(); + $files["$filename"] = array(); } foreach (registry_get_parsed_files() as $filename => $file) { Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.432 diff -u -p -r1.432 theme.inc --- includes/theme.inc 16 Aug 2008 21:05:49 -0000 1.432 +++ includes/theme.inc 24 Aug 2008 01:50:06 -0000 @@ -166,7 +166,7 @@ function _init_theme($theme, $base_theme // Initialize the theme. if (isset($theme->engine)) { // Include the engine. - include_once './' . $theme->owner; + include_once DRUPAL_ROOT . '/' . $theme->owner; $theme_engine = $theme->engine; if (function_exists($theme_engine . '_init')) { @@ -181,12 +181,12 @@ function _init_theme($theme, $base_theme foreach ($base_theme as $base) { // Include the theme file or the engine. if (!empty($base->owner)) { - include_once './' . $base->owner; + include_once DRUPAL_ROOT . '/' . $base->owner; } } // and our theme gets one too. if (!empty($theme->owner)) { - include_once './' . $theme->owner; + include_once DRUPAL_ROOT . '/' . $theme->owner; } } @@ -295,10 +295,10 @@ function _theme_process_registry(&$cache // files can prevent them from getting registered. if (isset($info['file']) && !isset($info['path'])) { $result[$hook]['file'] = $path . '/' . $info['file']; - include_once($result[$hook]['file']); + include_once DRUPAL_ROOT . '/' . $result[$hook]['file']; } elseif (isset($info['file']) && isset($info['path'])) { - include_once($info['path'] . '/' . $info['file']); + include_once DRUPAL_ROOT . '/' . $info['path'] . '/' . $info['file']; } if (isset($info['template']) && !isset($info['path'])) { @@ -597,7 +597,7 @@ function theme() { if (isset($info['path'])) { $include_file = $info['path'] . '/' . $include_file; } - include_once($include_file); + include_once DRUPAL_ROOT . '/' . $include_file; } if (isset($info['function'])) { // The theme call is a function. @@ -971,12 +971,12 @@ function theme_get_setting($setting_name * The output generated by the template. */ function theme_render_template($file, $variables) { - extract($variables, EXTR_SKIP); // Extract the variables to a local namespace - ob_start(); // Start output buffering - include "./$file"; // Include the file - $contents = ob_get_contents(); // Get the contents of the buffer - ob_end_clean(); // End buffering and discard - return $contents; // Return the contents + extract($variables, EXTR_SKIP); // Extract the variables to a local namespace + ob_start(); // Start output buffering + include DRUPAL_ROOT . '/' . $file; // Include the file + $contents = ob_get_contents(); // Get the contents of the buffer + ob_end_clean(); // End buffering and discard + return $contents; // Return the contents } /** Index: includes/theme.maintenance.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.maintenance.inc,v retrieving revision 1.16 diff -u -p -r1.16 theme.maintenance.inc --- includes/theme.maintenance.inc 21 Aug 2008 19:36:36 -0000 1.16 +++ includes/theme.maintenance.inc 24 Aug 2008 01:31:33 -0000 @@ -22,13 +22,13 @@ function _drupal_maintenance_theme() { return; } - require_once './includes/path.inc'; - require_once './includes/theme.inc'; - require_once './includes/common.inc'; - require_once './includes/unicode.inc'; - require_once './includes/file.inc'; - require_once './includes/module.inc'; - require_once './includes/database/database.inc'; + require_once DRUPAL_ROOT . '/includes/path.inc'; + require_once DRUPAL_ROOT . '/includes/theme.inc'; + require_once DRUPAL_ROOT . '/includes/common.inc'; + require_once DRUPAL_ROOT . '/includes/unicode.inc'; + require_once DRUPAL_ROOT . '/includes/file.inc'; + require_once DRUPAL_ROOT . '/includes/module.inc'; + require_once DRUPAL_ROOT . '/includes/database/database.inc'; unicode_check(); // Install and update pages are treated differently to prevent theming overrides. Index: includes/database/database.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database/database.inc,v retrieving revision 1.1 diff -u -p -r1.1 database.inc --- includes/database/database.inc 21 Aug 2008 19:36:36 -0000 1.1 +++ includes/database/database.inc 24 Aug 2008 01:24:48 -0000 @@ -825,8 +825,7 @@ abstract class Database { // We cannot rely on the registry yet, because the registry requires // an open database connection. $driver_class = 'DatabaseConnection_' . $driver; - $driver_file = './includes/database/' . $driver . '/database.inc'; - require_once($driver_file); + require_once DRUPAL_ROOT . '/includes/database/' . $driver . '/database.inc'; self::$connections[$key][$target] = new $driver_class(self::$databaseInfo[$key][$target]); // We need to pass around the simpletest database prefix in the request @@ -1808,7 +1807,7 @@ function db_result(DatabaseStatement $st function _db_need_install() { if (!function_exists('install_goto')) { - include_once 'includes/install.inc'; + include_once DRUPAL_ROOT . '/includes/install.inc'; install_goto('install.php'); } } Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.220 diff -u -p -r1.220 locale.module --- modules/locale/locale.module 24 Jul 2008 16:25:18 -0000 1.220 +++ modules/locale/locale.module 24 Aug 2008 01:20:54 -0000 @@ -187,7 +187,7 @@ function locale_menu() { function locale_inc_callback() { $args = func_get_args(); $function = array_shift($args); - include_once './includes/locale.inc'; + include_once DRUPAL_ROOT . '/includes/locale.inc'; return call_user_func_array($function, $args); } @@ -484,7 +484,7 @@ function locale_language_list($field = ' * translations for. */ function locale_system_update($components) { - include_once 'includes/locale.inc'; + include_once DRUPAL_ROOT . '/includes/locale.inc'; if ($batch = locale_batch_by_component($components)) { batch_set($batch); } Index: modules/simpletest/drupal_web_test_case.php =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v retrieving revision 1.34 diff -u -p -r1.34 drupal_web_test_case.php --- modules/simpletest/drupal_web_test_case.php 23 Aug 2008 07:42:54 -0000 1.34 +++ modules/simpletest/drupal_web_test_case.php 24 Aug 2008 01:47:50 -0000 @@ -646,7 +646,7 @@ class DrupalWebTestCase { // Generate temporary prefixed database to ensure that tests have a clean starting point. $db_prefix = 'simpletest' . mt_rand(1000, 1000000); - include_once './includes/install.inc'; + include_once DRUPAL_ROOT . '/includes/install.inc'; drupal_install_system(); // Add the specified modules to the list of modules in the default profile. Index: modules/simpletest/simpletest.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.module,v retrieving revision 1.11 diff -u -p -r1.11 simpletest.module --- modules/simpletest/simpletest.module 21 Aug 2008 19:36:38 -0000 1.11 +++ modules/simpletest/simpletest.module 24 Aug 2008 01:47:31 -0000 @@ -411,7 +411,7 @@ function _simpletest_batch_finished($suc function simpletest_get_all_tests() { static $formatted_classes; if (!isset($formatted_classes)) { - require_once drupal_get_path('module', 'simpletest') . '/drupal_web_test_case.php'; + require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'simpletest') . '/drupal_web_test_case.php'; $files = array(); foreach (array_keys(module_rebuild_cache()) as $module) { $module_path = drupal_get_path('module', $module); @@ -430,7 +430,7 @@ function simpletest_get_all_tests() { $existing_classes = get_declared_classes(); foreach ($files as $file) { - include_once($file); + include_once DRUPAL_ROOT . '/' . $file; } $classes = array_values(array_diff(get_declared_classes(), $existing_classes)); $formatted_classes = array(); Index: modules/simpletest/tests/registry.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/registry.test,v retrieving revision 1.1 diff -u -p -r1.1 registry.test --- modules/simpletest/tests/registry.test 14 Aug 2008 09:18:28 -0000 1.1 +++ modules/simpletest/tests/registry.test 24 Aug 2008 02:40:57 -0000 @@ -89,11 +89,11 @@ class RegistryParseFilesTestCase extends if ($fileType == 'existing_changed') { // Insert a record with a dodgy md5. $this->$fileType->fakeMD5 = md5($this->$fileType->contents . rand()); - db_query("INSERT INTO {registry_file} (md5, filename) VALUES ('%s', '%s')", $this->$fileType->fakeMD5, './' . $this->$fileType->fileName); + db_query("INSERT INTO {registry_file} (md5, filename) VALUES ('%s', '%s')", $this->$fileType->fakeMD5, $this->$fileType->fileName); // Insert some fake resource records. foreach (array('function', 'class', 'interface') as $type) { - db_query("INSERT INTO {registry} (name, type, filename) VALUES ('%s', '%s', '%s')", $type . md5(rand()), $type, './' . $this->$fileType->fileName); + db_query("INSERT INTO {registry} (name, type, filename) VALUES ('%s', '%s', '%s')", $type . md5(rand()), $type, $this->$fileType->fileName); } } } @@ -111,7 +111,7 @@ class RegistryParseFilesTestCase extends $this->assertTrue($this->$fileType->$resource == $foundName, t('Resource "@resource" found.', array('@resource' => $this->$fileType->$resource))); } // Test that we have the right md5. - $md5 = db_result(db_query("SELECT md5 FROM {registry_file} WHERE filename = '%s'", './' . $this->$fileType->fileName)); + $md5 = db_result(db_query("SELECT md5 FROM {registry_file} WHERE filename = '%s'", $this->$fileType->fileName)); $this->assertTrue(md5($this->$fileType->contents) == $md5, t('MD5 for "@filename" matched.' . $fileType . $md5, array('@filename' => $this->$fileType->fileName))); } } @@ -123,10 +123,10 @@ class RegistryParseFilesTestCase extends $files = array(); foreach ($this->fileTypes as $fileType) { if ($fileType == 'existing_changed') { - $files['./' . $this->$fileType->fileName] = array('md5' => $this->$fileType->fakeMD5); + $files[$this->$fileType->fileName] = array('md5' => $this->$fileType->fakeMD5); } else { - $files['./' . $this->$fileType->fileName] = array(); + $files[$this->$fileType->fileName] = array(); } } return $files; Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.85 diff -u -p -r1.85 system.admin.inc --- modules/system/system.admin.inc 21 Aug 2008 19:36:38 -0000 1.85 +++ modules/system/system.admin.inc 24 Aug 2008 01:42:46 -0000 @@ -485,11 +485,11 @@ function system_theme_settings(&$form_st if ($key) { // Include the theme's theme-settings.php file - $filename = './' . str_replace("/$key.info", '', $themes[$key]->filename) . '/theme-settings.php'; + $filename = DRUPAL_ROOT . '/' . str_replace("/$key.info", '', $themes[$key]->filename) . '/theme-settings.php'; if (!file_exists($filename) and !empty($themes[$key]->info['base theme'])) { // If the theme doesn't have a theme-settings.php file, use the base theme's. $base = $themes[$key]->info['base theme']; - $filename = './' . str_replace("/$base.info", '', $themes[$base]->filename) . '/theme-settings.php'; + $filename = DRUPAL_ROOT . '/' . str_replace("/$base.info", '', $themes[$base]->filename) . '/theme-settings.php'; } if (file_exists($filename)) { require_once $filename; @@ -839,7 +839,7 @@ function system_modules_confirm_form($mo * Submit callback; handles modules form submission. */ function system_modules_submit($form, &$form_state) { - include_once './includes/install.inc'; + include_once DRUPAL_ROOT . '/includes/install.inc'; $modules = array(); // If we're not coming from the confirmation form, build the list of modules. if (!isset($form_state['storage'])) { @@ -986,7 +986,7 @@ function system_modules_submit($form, &$ */ function system_modules_uninstall($form_state = NULL) { // Make sure the install API is available. - include_once './includes/install.inc'; + include_once DRUPAL_ROOT . '/includes/install.inc'; // Display the confirm form if any modules have been submitted. if (isset($form_state) && $confirm_form = system_modules_uninstall_confirm_form($form_state['storage'])) { @@ -1087,7 +1087,7 @@ function system_modules_uninstall_valida */ function system_modules_uninstall_submit($form, &$form_state) { // Make sure the install API is available. - include_once './includes/install.inc'; + include_once DRUPAL_ROOT . '/includes/install.inc'; if (!empty($form['#confirmed'])) { // Call the uninstall routine for each selected module. @@ -1769,7 +1769,7 @@ function system_clean_url_settings() { */ function system_status($check = FALSE) { // Load .install files - include_once './includes/install.inc'; + include_once DRUPAL_ROOT . '/includes/install.inc'; drupal_load_updates(); // Check run-time requirements and status information. @@ -1877,7 +1877,7 @@ function system_sql() { * Default page callback for batches. */ function system_batch_page() { - require_once './includes/batch.inc'; + require_once DRUPAL_ROOT . '/includes/batch.inc'; $output = _batch_page(); if ($output === FALSE) { drupal_access_denied(); Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.261 diff -u -p -r1.261 system.install --- modules/system/system.install 23 Aug 2008 08:15:37 -0000 1.261 +++ modules/system/system.install 24 Aug 2008 01:19:25 -0000 @@ -268,7 +268,7 @@ function system_requirements($phase) { } // Test Unicode library - include_once './includes/unicode.inc'; + include_once DRUPAL_ROOT . '/includes/unicode.inc'; $requirements = array_merge($requirements, unicode_requirements()); // Check for update status module. Index: modules/update/update.fetch.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/update/update.fetch.inc,v retrieving revision 1.9 diff -u -p -r1.9 update.fetch.inc --- modules/update/update.fetch.inc 14 Apr 2008 17:48:43 -0000 1.9 +++ modules/update/update.fetch.inc 24 Aug 2008 01:20:18 -0000 @@ -108,7 +108,7 @@ function _update_build_fetch_url($projec * @see update_requirements() */ function _update_cron_notify() { - include_once './includes/install.inc'; + include_once DRUPAL_ROOT . '/includes/install.inc'; $status = update_requirements('runtime'); $params = array(); foreach (array('core', 'contrib') as $report_type) { Index: modules/update/update.module =================================================================== RCS file: /cvs/drupal/drupal/modules/update/update.module,v retrieving revision 1.21 diff -u -p -r1.21 update.module --- modules/update/update.module 22 Aug 2008 12:30:19 -0000 1.21 +++ modules/update/update.module 24 Aug 2008 01:20:04 -0000 @@ -63,7 +63,7 @@ function update_help($path, $arg) { return $output; case 'admin/build/themes': case 'admin/build/modules': - include_once './includes/install.inc'; + include_once DRUPAL_ROOT . '/includes/install.inc'; $status = update_requirements('runtime'); foreach (array('core', 'contrib') as $report_type) { $type = 'update_' . $report_type; @@ -95,7 +95,7 @@ function update_help($path, $arg) { // update missing, print an error message about it. if (arg(0) == 'admin' && strpos($path, '#') === FALSE && user_access('administer site configuration')) { - include_once './includes/install.inc'; + include_once DRUPAL_ROOT . '/includes/install.inc'; $status = update_requirements('runtime'); foreach (array('core', 'contrib') as $report_type) { $type = 'update_' . $report_type; Index: modules/user/user.install =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.install,v retrieving revision 1.12 diff -u -p -r1.12 user.install --- modules/user/user.install 7 May 2008 19:34:24 -0000 1.12 +++ modules/user/user.install 24 Aug 2008 01:35:21 -0000 @@ -251,7 +251,7 @@ function user_update_7000(&$sandbox) { $sandbox['user_count'] = db_result(db_query("SELECT COUNT(uid) FROM {users}")); } else { - require_once variable_get('password_inc', './includes/password.inc'); + require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc'); // Hash again all current hashed passwords. $has_rows = FALSE; // Update this many per page load. Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.917 diff -u -p -r1.917 user.module --- modules/user/user.module 21 Aug 2008 19:36:39 -0000 1.917 +++ modules/user/user.module 24 Aug 2008 01:34:34 -0000 @@ -222,7 +222,7 @@ function user_save($account, $edit = arr if (!empty($edit['pass'])) { // Allow alternate password hashing schemes. - require_once variable_get('password_inc', './includes/password.inc'); + require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc'); $edit['pass'] = user_hash_password(trim($edit['pass'])); // Abort if the hashing failed and returned FALSE. if (!$edit['pass']) { @@ -1310,7 +1310,7 @@ function user_authenticate($form_values $account = db_fetch_object(db_query("SELECT * FROM {users} WHERE name = '%s' AND status = 1", $form_values['name'])); if ($account) { // Allow alternate password hashing schemes. - require_once variable_get('password_inc', './includes/password.inc'); + require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc'); if (user_check_password($password, $account)) { if (user_needs_new_hash($account)) { $new_hash = user_hash_password($password); Index: modules/user/user.test =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.test,v retrieving revision 1.10 diff -u -p -r1.10 user.test --- modules/user/user.test 27 Jun 2008 07:25:11 -0000 1.10 +++ modules/user/user.test 24 Aug 2008 01:35:05 -0000 @@ -75,7 +75,7 @@ class UserRegistrationTestCase extends D $this->assertText(t('The changes have been saved.'), t('Password changed to @password', array('@password' => $new_pass))); // Make sure password changes are present in database. - require_once variable_get('password_inc', './includes/password.inc'); + require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc'); $user = user_load(array('uid' => $user->uid)); $this->assertTrue(user_check_password($new_pass, $user), t('Correct password in database.')); Index: scripts/password-hash.sh =================================================================== RCS file: /cvs/drupal/drupal/scripts/password-hash.sh,v retrieving revision 1.1 diff -u -p -r1.1 password-hash.sh --- scripts/password-hash.sh 31 Mar 2008 20:50:05 -0000 1.1 +++ scripts/password-hash.sh 24 Aug 2008 01:41:14 -0000 @@ -83,8 +83,10 @@ while ($param = array_shift($_SERVER['ar } } -include_once('includes/password.inc'); -include_once('includes/common.inc'); +define('DRUPAL_ROOT', getcwd()); + +include_once DRUPAL_ROOT . '/includes/password.inc'; +include_once DRUPAL_ROOT . '/includes/common.inc'; foreach ($passwords as $password) { print("\npassword: $password \t\thash: ". user_hash_password($password) ."\n"); Index: scripts/run-tests.sh =================================================================== RCS file: /cvs/drupal/drupal/scripts/run-tests.sh,v retrieving revision 1.7 diff -u -p -r1.7 run-tests.sh --- scripts/run-tests.sh 18 Aug 2008 18:52:31 -0000 1.7 +++ scripts/run-tests.sh 24 Aug 2008 01:38:20 -0000 @@ -245,7 +245,8 @@ function simpletest_script_init() { $_SERVER['HTTP_USER_AGENT'] = 'Drupal command line'; chdir(realpath(dirname(__FILE__) . '/..')); - require_once './includes/bootstrap.inc'; + define('DRUPAL_ROOT', getcwd()); + require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; } /** Index: themes/engines/phptemplate/phptemplate.engine =================================================================== RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/phptemplate.engine,v retrieving revision 1.70 diff -u -p -r1.70 phptemplate.engine --- themes/engines/phptemplate/phptemplate.engine 14 Apr 2008 17:48:45 -0000 1.70 +++ themes/engines/phptemplate/phptemplate.engine 24 Aug 2008 01:21:24 -0000 @@ -9,7 +9,7 @@ function phptemplate_init($template) { $file = dirname($template->filename) . '/template.php'; if (file_exists($file)) { - include_once "./$file"; + include_once DRUPAL_ROOT . '/' . $file; } }