Issue #1827448 by RobLoach, sun, jbrown, tstoeckler: Use __DIR__ instead of DRUPAL_ROOT where possible/sensible.

8.0.x
Nathaniel Catchpole 2013-05-09 10:25:10 +01:00
parent a90da0d23e
commit ca665f7be3
23 changed files with 99 additions and 99 deletions

View File

@ -90,10 +90,10 @@ $show_messages = TRUE;
if (authorize_access_allowed()) {
// Load both the Form API and Batch API.
require_once DRUPAL_ROOT . '/core/includes/form.inc';
require_once DRUPAL_ROOT . '/core/includes/batch.inc';
require_once __DIR__ . '/includes/form.inc';
require_once __DIR__ . '/includes/batch.inc';
// Load the code that drives the authorize process.
require_once DRUPAL_ROOT . '/core/includes/authorize.inc';
require_once __DIR__ . '/includes/authorize.inc';
if (isset($_SESSION['authorize_operation']['page_title'])) {
drupal_set_title($_SESSION['authorize_operation']['page_title']);

View File

@ -887,7 +887,7 @@ function drupal_get_filename($type, $name, $filename = NULL) {
if (!isset($dirs[$dir][$extension])) {
$dirs[$dir][$extension] = TRUE;
if (!function_exists('drupal_system_listing')) {
require_once DRUPAL_ROOT . '/core/includes/common.inc';
require_once __DIR__ . '/common.inc';
}
// Scan the appropriate directories for all files with the requested
// extension, not just the file we are currently looking for. This
@ -1617,7 +1617,7 @@ function watchdog_exception($type, Exception $exception, $message = NULL, $varia
$variables = array();
}
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
require_once __DIR__ . '/errors.inc';
$variables += _drupal_decode_exception($exception);
watchdog($type, $message, $variables, $severity, $link);
}
@ -1947,7 +1947,7 @@ function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
break;
case DRUPAL_BOOTSTRAP_CODE:
require_once DRUPAL_ROOT . '/core/includes/common.inc';
require_once __DIR__ . '/common.inc';
_drupal_bootstrap_code();
break;
@ -2053,7 +2053,7 @@ function drupal_get_hash_salt() {
* occurred.
*/
function _drupal_error_handler($error_level, $message, $filename, $line, $context) {
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
require_once __DIR__ . '/errors.inc';
_drupal_error_handler_real($error_level, $message, $filename, $line, $context);
}
@ -2068,7 +2068,7 @@ function _drupal_error_handler($error_level, $message, $filename, $line, $contex
* The exception object that was thrown.
*/
function _drupal_exception_handler($exception) {
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
require_once __DIR__ . '/errors.inc';
try {
// Log the message to the watchdog and return an error page to the user.
@ -2106,7 +2106,7 @@ function _drupal_bootstrap_configuration() {
Unicode::check();
// Load the procedural configuration system helper functions.
require_once DRUPAL_ROOT . '/core/includes/config.inc';
require_once __DIR__ . '/config.inc';
// Set the Drupal custom error handler. (requires config())
set_error_handler('_drupal_error_handler');
@ -2116,7 +2116,7 @@ function _drupal_bootstrap_configuration() {
// installed yet (i.e., if no $databases array has been defined in the
// settings.php file) and we are not already installing.
if (empty($GLOBALS['databases']) && !drupal_installation_attempted()) {
include_once DRUPAL_ROOT . '/core/includes/install.inc';
include_once __DIR__ . '/install.inc';
install_goto('core/install.php');
}
}
@ -2141,7 +2141,7 @@ function _drupal_bootstrap_page_cache() {
// Allow specifying special cache handlers in settings.php, like
// using memcached or files for storing cache information.
require_once DRUPAL_ROOT . '/core/includes/cache.inc';
require_once __DIR__ . '/cache.inc';
foreach (variable_get('cache_backends', array()) as $include) {
require_once DRUPAL_ROOT . '/' . $include;
}
@ -2218,7 +2218,7 @@ function _drupal_initialize_db_test_prefix() {
function _drupal_bootstrap_database() {
// Initialize the database system. Note that the connection
// won't be initialized until it is actually requested.
require_once DRUPAL_ROOT . '/core/includes/database.inc';
require_once __DIR__ . '/database.inc';
}
/**
@ -2230,7 +2230,7 @@ function _drupal_bootstrap_variables() {
// Load variables from the database, but do not overwrite variables set in settings.php.
$conf = variable_initialize(isset($conf) ? $conf : array());
// Load bootstrap modules.
require_once DRUPAL_ROOT . '/core/includes/module.inc';
require_once __DIR__ . '/module.inc';
drupal_container()->get('module_handler')->loadBootstrapModules();
}
@ -2505,7 +2505,7 @@ function drupal_generate_test_ua($prefix) {
* @see _drupal_maintenance_theme()
*/
function drupal_maintenance_theme() {
require_once DRUPAL_ROOT . '/core/includes/theme.maintenance.inc';
require_once __DIR__ . '/theme.maintenance.inc';
_drupal_maintenance_theme();
}
@ -3218,7 +3218,7 @@ function _drupal_shutdown_function() {
catch (Exception $exception) {
// If we are displaying errors, then do so with no possibility of a further
// uncaught exception being thrown.
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
require_once __DIR__ . '/errors.inc';
if (error_displayable()) {
print '<h1>Uncaught exception thrown in shutdown function.</h1>';
print '<p>' . _drupal_render_exception_safe($exception) . '</p><hr />';

View File

@ -1239,7 +1239,7 @@ function filter_xss_bad_protocol($string, $decode = TRUE) {
// string that needs decoding.
if ($decode) {
if (!function_exists('decode_entities')) {
require_once DRUPAL_ROOT . '/core/includes/unicode.inc';
require_once __DIR__ . '/unicode.inc';
}
$string = decode_entities($string);
@ -4567,20 +4567,20 @@ function drupal_valid_token($token, $value = '', $skip_anonymous = FALSE) {
* Loads code for subsystems and modules, and registers stream wrappers.
*/
function _drupal_bootstrap_code() {
require_once DRUPAL_ROOT . '/' . settings()->get('path_inc', 'core/includes/path.inc');
require_once DRUPAL_ROOT . '/core/includes/theme.inc';
require_once DRUPAL_ROOT . '/core/includes/pager.inc';
require_once DRUPAL_ROOT . '/' . settings()->get('menu_inc', 'core/includes/menu.inc');
require_once DRUPAL_ROOT . '/core/includes/tablesort.inc';
require_once DRUPAL_ROOT . '/core/includes/file.inc';
require_once DRUPAL_ROOT . '/core/includes/unicode.inc';
require_once DRUPAL_ROOT . '/core/includes/image.inc';
require_once DRUPAL_ROOT . '/core/includes/form.inc';
require_once DRUPAL_ROOT . '/core/includes/mail.inc';
require_once DRUPAL_ROOT . '/core/includes/ajax.inc';
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
require_once DRUPAL_ROOT . '/core/includes/schema.inc';
require_once DRUPAL_ROOT . '/core/includes/entity.inc';
require_once __DIR__ . '/../../' . settings()->get('path_inc', 'core/includes/path.inc');
require_once __DIR__ . '/theme.inc';
require_once __DIR__ . '/pager.inc';
require_once __DIR__ . '/../../' . settings()->get('menu_inc', 'core/includes/menu.inc');
require_once __DIR__ . '/tablesort.inc';
require_once __DIR__ . '/file.inc';
require_once __DIR__ . '/unicode.inc';
require_once __DIR__ . '/image.inc';
require_once __DIR__ . '/form.inc';
require_once __DIR__ . '/mail.inc';
require_once __DIR__ . '/ajax.inc';
require_once __DIR__ . '/errors.inc';
require_once __DIR__ . '/schema.inc';
require_once __DIR__ . '/entity.inc';
// Load all enabled modules
drupal_container()->get('module_handler')->loadAll();

View File

@ -60,7 +60,7 @@ function _drupal_error_handler_real($error_level, $message, $filename, $line, $c
$caller = _drupal_get_last_caller($backtrace);
if (!function_exists('filter_xss_admin')) {
require_once DRUPAL_ROOT . '/core/includes/common.inc';
require_once __DIR__ . '/common.inc';
}
// We treat recoverable errors as fatal.

View File

@ -5161,7 +5161,7 @@ function batch_process($redirect = NULL, $url = 'batch', $redirect_callback = 'd
else {
// Non-progressive execution: bypass the whole progressbar workflow
// and execute the batch in one pass.
require_once DRUPAL_ROOT . '/core/includes/batch.inc';
require_once __DIR__ . '/batch.inc';
_batch_process();
}
}

View File

@ -296,17 +296,17 @@ function install_begin_request(&$install_state) {
$GLOBALS['conf']['language_default'] = array('langcode' => $install_state['parameters']['langcode']);
}
require_once DRUPAL_ROOT . '/core/modules/system/system.install';
require_once DRUPAL_ROOT . '/core/includes/common.inc';
require_once DRUPAL_ROOT . '/core/includes/file.inc';
require_once DRUPAL_ROOT . '/core/includes/install.inc';
require_once DRUPAL_ROOT . '/core/includes/schema.inc';
require_once DRUPAL_ROOT . '/' . settings()->get('path_inc', 'core/includes/path.inc');
require_once __DIR__ . '/../modules/system/system.install';
require_once __DIR__ . '/common.inc';
require_once __DIR__ . '/file.inc';
require_once __DIR__ . '/install.inc';
require_once __DIR__ . '/schema.inc';
require_once __DIR__ . '/../../' . settings()->get('path_inc', 'core/includes/path.inc');
// Load module basics (needed for hook invokes).
include_once DRUPAL_ROOT . '/core/includes/module.inc';
include_once DRUPAL_ROOT . '/core/includes/session.inc';
require_once DRUPAL_ROOT . '/core/includes/entity.inc';
include_once __DIR__ . '/module.inc';
include_once __DIR__ . '/session.inc';
require_once __DIR__ . '/entity.inc';
// Determine whether the configuration system is ready to operate.
$install_state['config_verified'] = install_verify_config_directory(CONFIG_ACTIVE_DIRECTORY) && install_verify_config_directory(CONFIG_STAGING_DIRECTORY);
@ -412,7 +412,7 @@ function install_begin_request(&$install_state) {
// Set up $language, so t() caller functions will still work.
drupal_language_initialize();
require_once DRUPAL_ROOT . '/core/includes/ajax.inc';
require_once __DIR__ . '/ajax.inc';
$module_handler = drupal_container()->get('module_handler');
if (!$module_handler->moduleExists('system')) {
@ -421,7 +421,7 @@ function install_begin_request(&$install_state) {
}
$module_handler->load('system');
require_once DRUPAL_ROOT . '/core/includes/cache.inc';
require_once __DIR__ . '/cache.inc';
// Prepare for themed output. We need to run this at the beginning of the
// page request to avoid a different theme accidentally getting set. (We also
@ -433,7 +433,7 @@ function install_begin_request(&$install_state) {
if ($install_state['database_verified']) {
// Initialize the database system. Note that the connection
// won't be initialized until it is actually requested.
require_once DRUPAL_ROOT . '/core/includes/database.inc';
require_once __DIR__ . '/database.inc';
// Verify the last completed task in the database, if there is one.
$task = install_verify_completed_task();
@ -532,7 +532,7 @@ function install_run_task($task, &$install_state) {
$function = $task['function'];
if ($task['type'] == 'form') {
require_once DRUPAL_ROOT . '/core/includes/form.inc';
require_once __DIR__ . '/form.inc';
if ($install_state['interactive']) {
// For interactive forms, build the form and ensure that it will not
// redirect, since the installer handles its own redirection only after
@ -603,7 +603,7 @@ function install_run_task($task, &$install_state) {
// If we are in the middle of processing this batch, keep sending back
// any output from the batch process, until the task is complete.
elseif ($current_batch == $function) {
include_once DRUPAL_ROOT . '/core/includes/batch.inc';
include_once __DIR__ . '/batch.inc';
$output = _batch_page();
// Because Batch API now returns a JSON response for intermediary steps,
// but the installer doesn't handle Response objects yet, just send the
@ -1197,7 +1197,7 @@ function install_select_profile(&$install_state) {
// yet), rather just a convenience method for setting parameters in the
// URL.
if ($install_state['interactive']) {
include_once DRUPAL_ROOT . '/core/includes/form.inc';
include_once __DIR__ . '/form.inc';
drupal_set_title(st('Select an installation profile'));
$form = drupal_get_form('install_select_profile_form', $install_state);
return drupal_render($form);
@ -1401,7 +1401,7 @@ function install_translation_directory() {
* language cannot be chosen automatically.
*/
function install_select_language(&$install_state) {
include_once DRUPAL_ROOT . '/core/includes/standard.inc';
include_once __DIR__ . '/standard.inc';
// Find all available translation files.
$files = install_find_translations();
@ -1430,7 +1430,7 @@ function install_select_language(&$install_state) {
// corresponding languages to choose from.
if ($install_state['interactive']) {
drupal_set_title(st('Choose language'));
include_once DRUPAL_ROOT . '/core/includes/form.inc';
include_once __DIR__ . '/form.inc';
$elements = drupal_get_form('install_select_language_form', count($files) > 1 ? $files : array());
return drupal_render($elements);
}
@ -1460,9 +1460,9 @@ function install_select_language(&$install_state) {
* @ingroup forms
*/
function install_select_language_form($form, &$form_state, $files = array()) {
include_once DRUPAL_ROOT . '/core/includes/standard.inc';
include_once DRUPAL_ROOT . '/core/modules/language/language.module';
include_once DRUPAL_ROOT . '/core/modules/language/language.negotiation.inc';
include_once __DIR__ . '/standard.inc';
include_once __DIR__ . '/../modules/language/language.module';
include_once __DIR__ . '/../modules/language/language.negotiation.inc';
$standard_languages = standard_language_list();
$select_options = array();
@ -1740,8 +1740,8 @@ function install_profile_modules(&$install_state) {
* The batch definition, if there are language files to import.
*/
function install_import_translations(&$install_state) {
include_once DRUPAL_ROOT . '/core/modules/locale/locale.bulk.inc';
include_once DRUPAL_ROOT . '/core/includes/standard.inc';
include_once __DIR__ . '/../modules/locale/locale.bulk.inc';
include_once __DIR__ . '/standard.inc';
$langcode = $install_state['parameters']['langcode'];
$standard_languages = standard_language_list();
@ -1957,7 +1957,7 @@ function _install_profile_modules_finished($success, $results, $operations) {
* Checks installation requirements and reports any errors.
*/
function install_check_translations($install_state) {
include_once DRUPAL_ROOT . '/core/includes/standard.inc';
include_once __DIR__ . '/standard.inc';
$requirements = array();
$readable = FALSE;

View File

@ -134,7 +134,7 @@ function drupal_get_database_types() {
// We define a driver as a directory in /core/includes/database that in turn
// contains a database.inc file. That allows us to drop in additional drivers
// without modifying the installer.
require_once DRUPAL_ROOT . '/core/includes/database.inc';
require_once __DIR__ . '/database.inc';
// Allow any valid PHP identifier.
// @see http://www.php.net/manual/en/language.variables.basics.php.
$mask = '/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/';
@ -566,8 +566,8 @@ function install_ensure_config_directory($type) {
* The list of modules to install.
*/
function drupal_verify_profile($install_state) {
include_once DRUPAL_ROOT . '/core/includes/file.inc';
include_once DRUPAL_ROOT . '/core/includes/common.inc';
include_once __DIR__ . '/file.inc';
include_once __DIR__ . '/common.inc';
$profile = $install_state['parameters']['profile'];
$profile_file = $install_state['profiles'][$profile]->uri;
@ -861,7 +861,7 @@ function drupal_install_fix_file($file, $mask, $message = TRUE) {
*/
function install_goto($path) {
global $base_url;
include_once DRUPAL_ROOT . '/core/includes/common.inc';
include_once __DIR__ . '/common.inc';
header('Location: ' . $base_url . '/' . $path);
header('Cache-Control: no-cache'); // Not a permanent redirect.
drupal_exit();
@ -968,7 +968,7 @@ function st($string, array $args = array(), array $options = array()) {
}
}
require_once DRUPAL_ROOT . '/core/includes/theme.inc';
require_once __DIR__ . '/theme.inc';
// Transform arguments before inserting them
foreach ($args as $key => $value) {
switch ($key[0]) {
@ -1000,7 +1000,7 @@ function st($string, array $args = array(), array $options = array()) {
* Array of the installation profile's requirements.
*/
function drupal_check_profile($profile, array $install_state) {
include_once DRUPAL_ROOT . '/core/includes/file.inc';
include_once __DIR__ . '/file.inc';
$profile_file = $install_state['profiles'][$profile]->uri;

View File

@ -75,7 +75,7 @@ function system_list($type) {
foreach ($lists['theme'] as $key => $theme) {
if (!empty($theme->info['base theme'])) {
// Make a list of the theme's base themes.
require_once DRUPAL_ROOT . '/core/includes/theme.inc';
require_once __DIR__ . '/theme.inc';
$lists['theme'][$key]->base_themes = drupal_find_base_themes($lists['theme'], $key);
// Don't proceed if there was a problem with the root base theme.
if (!current($lists['theme'][$key]->base_themes)) {
@ -154,7 +154,7 @@ function system_register($type, $name, $uri) {
*/
function module_load_install($module) {
// Make sure the installation API is available
include_once DRUPAL_ROOT . '/core/includes/install.inc';
include_once __DIR__ . '/install.inc';
return module_load_include('install', $module);
}
@ -282,7 +282,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
}
// Required for module installation checks.
include_once DRUPAL_ROOT . '/core/includes/install.inc';
include_once __DIR__ . '/install.inc';
$modules_installed = array();
$modules_enabled = array();

View File

@ -79,7 +79,7 @@ function drupal_get_complete_schema($rebuild = FALSE) {
// Load the .install files to get hook_schema.
drupal_container()->get('module_handler')->loadAllIncludes('install');
require_once DRUPAL_ROOT . '/core/includes/common.inc';
require_once __DIR__ . '/common.inc';
// Invoke hook_schema for all modules.
foreach (module_implements('schema') as $module) {
// Cast the result of hook_schema() to an array, as a NULL return value

View File

@ -220,7 +220,7 @@ function _drupal_session_write($sid, $value) {
return TRUE;
}
catch (Exception $exception) {
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
require_once __DIR__ . '/errors.inc';
// If we are displaying errors, then do so with no possibility of a further
// uncaught exception being thrown.
if (error_displayable()) {

View File

@ -25,11 +25,11 @@ function _drupal_maintenance_theme() {
}
require_once DRUPAL_ROOT . '/' . settings()->get('path_inc', 'core/includes/path.inc');
require_once DRUPAL_ROOT . '/core/includes/theme.inc';
require_once DRUPAL_ROOT . '/core/includes/common.inc';
require_once DRUPAL_ROOT . '/core/includes/unicode.inc';
require_once DRUPAL_ROOT . '/core/includes/file.inc';
require_once DRUPAL_ROOT . '/core/includes/module.inc';
require_once __DIR__ . '/theme.inc';
require_once __DIR__ . '/common.inc';
require_once __DIR__ . '/unicode.inc';
require_once __DIR__ . '/file.inc';
require_once __DIR__ . '/module.inc';
Unicode::check();
// Install and update pages are treated differently to prevent theming overrides.
@ -41,7 +41,7 @@ function _drupal_maintenance_theme() {
// environment, we need to bootstrap just enough to allow hook invocations
// to work. See _drupal_log_error().
if (!class_exists('Drupal\Core\Database\Database', FALSE)) {
require_once DRUPAL_ROOT . '/core/includes/database.inc';
require_once __DIR__ . '/database.inc';
}
// We use the default theme as the maintenance theme. If a default theme

View File

@ -90,8 +90,8 @@ function update_check_incompatibility($name, $type = 'module') {
* irreversible changes to the database are made here.
*/
function update_prepare_d8_bootstrap() {
include_once DRUPAL_ROOT . '/core/includes/install.inc';
include_once DRUPAL_ROOT . '/core/includes/schema.inc';
include_once __DIR__ . '/install.inc';
include_once __DIR__ . '/schema.inc';
// Bootstrap to configuration.
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
@ -735,7 +735,7 @@ function update_module_enable(array $modules, $schema_version = 0) {
// system_list_reset() is in module.inc but that would only be available
// once the variable bootstrap is done.
require_once DRUPAL_ROOT . '/core/includes/module.inc';
require_once __DIR__ . '/module.inc';
system_list_reset();
// @todo: figure out what to do about hook_install() and hook_enable().
}
@ -806,7 +806,7 @@ function update_do_one($module, $number, $dependency_map, &$context) {
catch (Exception $e) {
watchdog_exception('update', $e);
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
require_once __DIR__ . '/errors.inc';
$variables = _drupal_decode_exception($e);
unset($variables['backtrace']);
// The exception message is run through check_plain() by _drupal_decode_exception().

View File

@ -58,7 +58,7 @@ function aggregator_test_feed($use_last_modified = FALSE, $use_etag = FALSE) {
drupal_add_http_header('Content-Type', 'application/rss+xml; charset=utf-8');
// Read actual feed from file.
$file_name = DRUPAL_ROOT . '/' . drupal_get_path('module', 'aggregator') . '/tests/aggregator_test_rss091.xml';
$file_name = __DIR__ . '/aggregator_test_rss091.xml';
$handle = fopen($file_name, 'r');
$feed = fread($handle, filesize($file_name));
fclose($handle);

View File

@ -12,12 +12,12 @@ use Drupal\Core\Template\Attribute;
* mechanism for auto-loading core APIs, so we have to load them on
* every page request.
*/
require_once DRUPAL_ROOT . '/core/modules/field/field.crud.inc';
require_once DRUPAL_ROOT . '/core/modules/field/field.default.inc';
require_once DRUPAL_ROOT . '/core/modules/field/field.info.inc';
require_once DRUPAL_ROOT . '/core/modules/field/field.multilingual.inc';
require_once DRUPAL_ROOT . '/core/modules/field/field.attach.inc';
require_once DRUPAL_ROOT . '/core/modules/field/field.form.inc';
require_once __DIR__ . '/field.crud.inc';
require_once __DIR__ . '/field.default.inc';
require_once __DIR__ . '/field.info.inc';
require_once __DIR__ . '/field.multilingual.inc';
require_once __DIR__ . '/field.attach.inc';
require_once __DIR__ . '/field.form.inc';
/**
* @defgroup field Field API

View File

@ -15,9 +15,9 @@ use Drupal\Core\Entity\EntityInterface;
* test helper functions
*/
require_once DRUPAL_ROOT . '/core/modules/field/tests/modules/field_test/field_test.entity.inc';
require_once DRUPAL_ROOT . '/core/modules/field/tests/modules/field_test/field_test.field.inc';
require_once DRUPAL_ROOT . '/core/modules/field/tests/modules/field_test/field_test.storage.inc';
require_once __DIR__ . '/field_test.entity.inc';
require_once __DIR__ . '/field_test.field.inc';
require_once __DIR__ . '/field_test.storage.inc';
/**
* Implements hook_permission().

View File

@ -15,7 +15,7 @@ use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\ReplaceCommand;
// Load all Field module hooks for File.
require_once DRUPAL_ROOT . '/core/modules/file/file.field.inc';
require_once __DIR__ . '/file.field.inc';
/**
* Implements hook_help().

View File

@ -44,7 +44,7 @@ define('IMAGE_STORAGE_MODULE', IMAGE_STORAGE_OVERRIDE | IMAGE_STORAGE_DEFAULT);
define('IMAGE_DERIVATIVE_TOKEN', 'itok');
// Load all Field module hooks for Image.
require_once DRUPAL_ROOT . '/core/modules/image/image.field.inc';
require_once __DIR__ . '/image.field.inc';
/**
* Implements hook_help().
@ -817,7 +817,7 @@ function image_effect_definitions() {
}
else {
$effects = array();
include_once DRUPAL_ROOT . '/core/modules/image/image.effects.inc';
include_once __DIR__ . '/image.effects.inc';
foreach (module_implements('image_effect_info') as $module) {
foreach (module_invoke($module, 'image_effect_info') as $name => $effect) {
// Ensure the current toolkit supports the effect.

View File

@ -707,7 +707,7 @@ function language_language_negotiation_info() {
*/
function language_negotiation_include() {
include_once DRUPAL_ROOT . '/core/includes/language.inc';
include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'language') . '/language.negotiation.inc';
include_once __DIR__ . '/language.negotiation.inc';
}
/**

View File

@ -13,7 +13,7 @@ use Guzzle\Http\Exception\RequestException;
*/
// @todo Combine functions differently in files to avoid unnecessary includes.
// Follow-up issue http://drupal.org/node/1834298
require_once DRUPAL_ROOT . '/core/modules/locale/locale.translation.inc';
require_once __DIR__ . '/locale.translation.inc';
/**
* Batch operation callback: Check the availability of a remote po file.

View File

@ -12,7 +12,7 @@ use Drupal\Core\Cache;
*/
// @todo Combine functions differently in files to avoid unnecessary includes.
// Follow-up issue http://drupal.org/node/1834298
require_once DRUPAL_ROOT . '/core/modules/locale/locale.translation.inc';
require_once __DIR__ . '/locale.translation.inc';
/**
* Clear the project data table.

View File

@ -10,7 +10,7 @@
*/
// @todo Combine functions differently in files to avoid unnecessary includes.
// Follow-up issue http://drupal.org/node/1834298
require_once DRUPAL_ROOT . '/core/modules/locale/locale.translation.inc';
require_once __DIR__ . '/locale.translation.inc';
/**
* Builds a batch to check, download and import project translations.

View File

@ -1201,7 +1201,7 @@ function _system_batch_theme() {
// Retrieve the current state of the batch.
$batch = &batch_get();
if (!$batch && isset($_REQUEST['id'])) {
require_once DRUPAL_ROOT . '/core/includes/batch.inc';
require_once __DIR__ . '/../../includes/batch.inc';
$batch = batch_load($_REQUEST['id']);
}
// Use the same theme as the page that started the batch.
@ -3977,7 +3977,7 @@ function system_admin_paths() {
* An array of all country code => country name pairs.
*/
function country_get_list() {
include_once DRUPAL_ROOT . '/core/includes/standard.inc';
include_once __DIR__ . '/../../includes/standard.inc';
$countries = standard_country_list();
// Allow other modules to modify the country list.
drupal_alter('countries', $countries);

View File

@ -432,11 +432,11 @@ if (is_null($op)) {
// to run updates (since it may expose sensitive information about the site's
// configuration).
if (is_null($op) && update_access_allowed()) {
require_once DRUPAL_ROOT . '/core/includes/install.inc';
require_once __DIR__ . '/includes/install.inc';
require_once DRUPAL_ROOT . '/core/modules/system/system.install';
// Load module basics.
include_once DRUPAL_ROOT . '/core/includes/module.inc';
include_once __DIR__ . '/includes/module.inc';
$module_list['system'] = 'core/modules/system/system.module';
$module_handler = drupal_container()->get('module_handler');
$module_handler->setModuleList($module_list);
@ -471,8 +471,8 @@ ini_set('display_errors', TRUE);
// Only proceed with updates if the user is allowed to run them.
if (update_access_allowed()) {
include_once DRUPAL_ROOT . '/core/includes/install.inc';
include_once DRUPAL_ROOT . '/core/includes/batch.inc';
include_once __DIR__ . '/includes/install.inc';
include_once __DIR__ . '/includes/batch.inc';
drupal_load_updates();
update_fix_compatibility();