diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-09-20 20:22:25 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-09-20 20:22:25 +0000 |
commit | a3bb66e4e81817737ce02ce8f3d0cff5c32fdae9 (patch) | |
tree | e31979e262ad7731f7355c494ac722d474e74080 /modules | |
parent | 9c2e5a52c9762dacb97789226c2ee4065d1e18e9 (diff) | |
download | brdo-a3bb66e4e81817737ce02ce8f3d0cff5c32fdae9.tar.gz brdo-a3bb66e4e81817737ce02ce8f3d0cff5c32fdae9.tar.bz2 |
#259623 by dopry and Damien Tournoud: Convert includes/requires to use absolute paths.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/color/color.module | 2 | ||||
-rw-r--r-- | modules/locale/locale.module | 4 | ||||
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 2 | ||||
-rw-r--r-- | modules/simpletest/simpletest.module | 4 | ||||
-rw-r--r-- | modules/simpletest/tests/registry.test | 10 | ||||
-rw-r--r-- | modules/system/system.admin.inc | 14 | ||||
-rw-r--r-- | modules/system/system.install | 2 | ||||
-rw-r--r-- | modules/update/update.fetch.inc | 2 | ||||
-rw-r--r-- | modules/update/update.module | 4 | ||||
-rw-r--r-- | modules/user/user.install | 2 | ||||
-rw-r--r-- | modules/user/user.module | 4 | ||||
-rw-r--r-- | modules/user/user.test | 2 |
12 files changed, 26 insertions, 26 deletions
diff --git a/modules/color/color.module b/modules/color/color.module index a080efd86..92479c387 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -122,7 +122,7 @@ function _color_page_alter(&$vars) { */ function color_get_info($theme) { $path = drupal_get_path('theme', $theme); - $file = $path . '/color/color.inc'; + $file = DRUPAL_ROOT . '/' . $path . '/color/color.inc'; if ($path && file_exists($file)) { include $file; return $info; diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 54cea750f..113728f51 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -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 = 'name', $all = FALSE) { * 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); } diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index be73e5933..1971d92f5 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -686,7 +686,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. diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module index 138045f83..ff338b12f 100644 --- a/modules/simpletest/simpletest.module +++ b/modules/simpletest/simpletest.module @@ -424,7 +424,7 @@ function _simpletest_batch_finished($success, $results, $operations) { 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); @@ -443,7 +443,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(); diff --git a/modules/simpletest/tests/registry.test b/modules/simpletest/tests/registry.test index 13bfa9074..a167178b6 100644 --- a/modules/simpletest/tests/registry.test +++ b/modules/simpletest/tests/registry.test @@ -89,11 +89,11 @@ class RegistryParseFilesTestCase extends DrupalWebTestCase { 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 DrupalWebTestCase { $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 DrupalWebTestCase { $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; diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 1a177cfef..65554627b 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -485,11 +485,11 @@ function system_theme_settings(&$form_state, $key = '') { 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($modules, $storage) { * 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, &$form_state) { */ 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_validate($form, &$form_state) { */ 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(); diff --git a/modules/system/system.install b/modules/system/system.install index 0402a7bc6..d2eccffcc 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -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. diff --git a/modules/update/update.fetch.inc b/modules/update/update.fetch.inc index 4255a3a4f..a77225e6d 100644 --- a/modules/update/update.fetch.inc +++ b/modules/update/update.fetch.inc @@ -108,7 +108,7 @@ function _update_build_fetch_url($project, $site_key = '') { * @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) { diff --git a/modules/update/update.module b/modules/update/update.module index 6e9ed94f5..5036370cb 100644 --- a/modules/update/update.module +++ b/modules/update/update.module @@ -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; diff --git a/modules/user/user.install b/modules/user/user.install index df4b2670d..eaab91f94 100644 --- a/modules/user/user.install +++ b/modules/user/user.install @@ -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. diff --git a/modules/user/user.module b/modules/user/user.module index 73da67874..0dc6285a1 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -222,7 +222,7 @@ function user_save($account, $edit = array(), $category = 'account') { 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 = array()) { $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); diff --git a/modules/user/user.test b/modules/user/user.test index 7110276b7..cc9066115 100644 --- a/modules/user/user.test +++ b/modules/user/user.test @@ -75,7 +75,7 @@ class UserRegistrationTestCase extends DrupalWebTestCase { $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.')); |