Commit f434037c authored by quicksketch's avatar quicksketch Committed by catch

Issue #22336 by quicksketch, scor, boombatower, and rfay. Move all core Drupal...

Issue #22336 by quicksketch, scor, boombatower, and rfay. Move all core Drupal files under a core subdirectory.
parent 06fb770b
......@@ -97,6 +97,13 @@ DirectoryIndex index.php index.html index.htm
# uncomment the following line:
# RewriteBase /
# Redirect common PHP files to their new locations.
RewriteCond %{REQUEST_URI} ^(.*)?/(update.php) [OR]
RewriteCond %{REQUEST_URI} ^(.*)?/(install.php) [OR]
RewriteCond %{REQUEST_URI} ^(.*)?/(cron.php)
RewriteCond %{REQUEST_URI} !core
RewriteRule ^ %1/core/%2 [L,QSA,R=301]
# Pass all requests not referring directly to files in the filesystem to
# index.php. Clean URLs are handled in drupal_environment_initialize().
RewriteCond %{REQUEST_FILENAME} !-f
......
......@@ -17,7 +17,7 @@ Drupal community at http://drupal.org/community.
Legal information about Drupal:
* Know your rights when using Drupal:
See LICENSE.txt in the same directory as this document.
See LICENSE.txt in the "core" directory.
* Learn about the Drupal trademark and logo policy:
http://drupal.com/trademark
......@@ -35,7 +35,7 @@ core) available for download.
More about configuration:
* Install, upgrade, and maintain Drupal:
See INSTALL.txt and UPGRADE.txt in the same directory as this document.
See INSTALL.txt and UPGRADE.txt in the "core" directory.
* Learn about how to use Drupal to create your site:
http://drupal.org/documentation
* Download contributed modules to sites/all/modules to extend Drupal's
......
......@@ -286,9 +286,9 @@ INSTALLATION
crontab utility on Unix/Linux systems. The following crontab line uses the
wget command to visit the cron.php page, and runs each hour, on the hour:
0 * * * * wget -O - -q -t 1 http://example.com/cron.php?cron_key=YOURKEY
0 * * * * wget -O - -q -t 1 http://example.com/core/cron.php?cron_key=YOURKEY
Replace the text "http://example.com/cron.php?cron_key=YOURKEY" in the
Replace the text "http://example.com/core/cron.php?cron_key=YOURKEY" in the
example with the full URL displayed under "Cron maintenance tasks" on the
"Status report" page.
......
......@@ -95,7 +95,7 @@ following the instructions in the INTRODUCTION section at the top of this file:
5. Re-apply any modifications to files such as .htaccess or robots.txt.
6. Run update.php by visiting http://www.example.com/update.php (replace
6. Run update.php by visiting http://www.example.com/core/update.php (replace
www.example.com with your domain name). This will update the core database
tables.
......@@ -198,7 +198,7 @@ following the instructions in the INTRODUCTION section at the top of this file:
sites/default/settings.php
13. Run update.php by visiting http://www.example.com/update.php (replace
13. Run update.php by visiting http://www.example.com/core/update.php (replace
www.example.com with your domain name). This will update the core database
tables.
......
......@@ -20,6 +20,9 @@
* @link authorize Authorized operation helper functions @endlink
*/
// Change the directory to the Drupal root.
chdir('..');
/**
* Root directory of Drupal installation.
*/
......@@ -59,12 +62,12 @@ function authorize_access_allowed() {
// *** Real work of the script begins here. ***
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
require_once DRUPAL_ROOT . '/includes/session.inc';
require_once DRUPAL_ROOT . '/includes/common.inc';
require_once DRUPAL_ROOT . '/includes/file.inc';
require_once DRUPAL_ROOT . '/includes/module.inc';
require_once DRUPAL_ROOT . '/includes/ajax.inc';
require_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
require_once DRUPAL_ROOT . '/core/includes/session.inc';
require_once DRUPAL_ROOT . '/core/includes/common.inc';
require_once DRUPAL_ROOT . '/core/includes/file.inc';
require_once DRUPAL_ROOT . '/core/includes/module.inc';
require_once DRUPAL_ROOT . '/core/includes/ajax.inc';
// We prepare only a minimal bootstrap. This includes the database and
// variables, however, so we have access to the class autoloader registry.
......@@ -75,8 +78,8 @@ function authorize_access_allowed() {
// We have to enable the user and system modules, even to check access and
// display errors via the maintenance theme.
$module_list['system']['filename'] = 'modules/system/system.module';
$module_list['user']['filename'] = 'modules/user/user.module';
$module_list['system']['filename'] = 'core/modules/system/system.module';
$module_list['user']['filename'] = 'core/modules/user/user.module';
module_list(TRUE, FALSE, FALSE, $module_list);
drupal_load('module', 'system');
drupal_load('module', 'user');
......@@ -95,10 +98,10 @@ function authorize_access_allowed() {
if (authorize_access_allowed()) {
// Load both the Form API and Batch API.
require_once DRUPAL_ROOT . '/includes/form.inc';
require_once DRUPAL_ROOT . '/includes/batch.inc';
require_once DRUPAL_ROOT . '/core/includes/form.inc';
require_once DRUPAL_ROOT . '/core/includes/batch.inc';
// Load the code that drives the authorize process.
require_once DRUPAL_ROOT . '/includes/authorize.inc';
require_once DRUPAL_ROOT . '/core/includes/authorize.inc';
// For the sake of Batch API and a few other low-level functions, we need to
// initialize the URL path into $_GET['q']. However, we do not want to raise
......
......@@ -5,12 +5,15 @@
* Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).
*/
// Change the directory to the Drupal root.
chdir('..');
/**
* Root directory of Drupal installation.
*/
define('DRUPAL_ROOT', getcwd());
include_once DRUPAL_ROOT . '/includes/bootstrap.inc';
include_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
if (!isset($_GET['cron_key']) || variable_get('cron_key', 'drupal') != $_GET['cron_key']) {
......
......@@ -776,7 +776,15 @@ function drupal_settings_initialize() {
// $_SERVER['SCRIPT_NAME'] can, in contrast to $_SERVER['PHP_SELF'], not
// be modified by a visitor.
if ($dir = rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/')) {
$base_path = $dir;
// Remove "core" directory if present, allowing install.php, update.php,
// cron.php and others to auto-detect a base path.
$core_position = strrpos($dir, '/core');
if ($core_position !== FALSE && strlen($dir) - 5 == $core_position) {
$base_path = substr($dir, 0, $core_position);
}
else {
$base_path = $dir;
}
$base_url .= $base_path;
$base_path .= '/';
}
......@@ -906,7 +914,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 . '/includes/common.inc';
require_once DRUPAL_ROOT . '/core/includes/common.inc';
}
// Scan the appropriate directories for all files with the requested
// extension, not just the file we are currently looking for. This
......@@ -1670,7 +1678,7 @@ function watchdog_exception($type, Exception $exception, $message = NULL, $varia
$variables = array();
}
require_once DRUPAL_ROOT . '/includes/errors.inc';
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
$variables += _drupal_decode_exception($exception);
watchdog($type, $message, $variables, $severity, $link);
}
......@@ -2138,7 +2146,7 @@ function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
break;
case DRUPAL_BOOTSTRAP_SESSION:
require_once DRUPAL_ROOT . '/' . variable_get('session_inc', 'includes/session.inc');
require_once DRUPAL_ROOT . '/' . variable_get('session_inc', 'core/includes/session.inc');
drupal_session_initialize();
break;
......@@ -2151,7 +2159,7 @@ function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
break;
case DRUPAL_BOOTSTRAP_FULL:
require_once DRUPAL_ROOT . '/includes/common.inc';
require_once DRUPAL_ROOT . '/core/includes/common.inc';
_drupal_bootstrap_full();
break;
}
......@@ -2190,7 +2198,7 @@ function drupal_get_user_timezone() {
* An array that points to the active symbol table at the point the error occurred.
*/
function _drupal_error_handler($error_level, $message, $filename, $line, $context) {
require_once DRUPAL_ROOT . '/includes/errors.inc';
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
_drupal_error_handler_real($error_level, $message, $filename, $line, $context);
}
......@@ -2205,7 +2213,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 . '/includes/errors.inc';
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
try {
// Log the message to the watchdog and return an error page to the user.
......@@ -2237,7 +2245,7 @@ function _drupal_bootstrap_configuration() {
drupal_settings_initialize();
// Hook up the Symfony ClassLoader for loading PSR-0-compatible classes.
require_once(DRUPAL_ROOT . '/includes/Symfony/Component/ClassLoader/UniversalClassLoader.php');
require_once(DRUPAL_ROOT . '/core/includes/Symfony/Component/ClassLoader/UniversalClassLoader.php');
// By default, use the UniversalClassLoader which is best for development,
// as it does not break when code is moved on the file system. It is slow,
......@@ -2246,7 +2254,7 @@ function _drupal_bootstrap_configuration() {
switch (variable_get('autoloader_mode', 'default')) {
case 'apc':
if (function_exists('apc_store')) {
require_once(DRUPAL_ROOT . '/includes/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php');
require_once(DRUPAL_ROOT . '/core/includes/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php');
$loader = new \Symfony\Component\ClassLoader\ApcUniversalClassLoader('drupal.' . $GLOBALS['drupal_hash_salt']);
break;
}
......@@ -2261,10 +2269,10 @@ function _drupal_bootstrap_configuration() {
// Register classes with namespaces.
$loader->registerNamespaces(array(
// All Symfony-borrowed code lives in /includes/Symfony.
'Symfony' => DRUPAL_ROOT . '/includes',
// All Drupal-namespaced code in core lives in /includes/Drupal.
'Drupal' => DRUPAL_ROOT . '/includes',
// All Symfony-borrowed code lives in /core/includes/Symfony.
'Symfony' => DRUPAL_ROOT . '/core/includes',
// All Drupal-namespaced code in core lives in /core/includes/Drupal.
'Drupal' => DRUPAL_ROOT . '/core/includes',
));
// Activate the autoloader.
......@@ -2279,7 +2287,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 . '/includes/cache.inc';
require_once DRUPAL_ROOT . '/core/includes/cache.inc';
foreach (variable_get('cache_backends', array()) as $include) {
require_once DRUPAL_ROOT . '/' . $include;
}
......@@ -2335,8 +2343,8 @@ function _drupal_bootstrap_database() {
// 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 . '/includes/install.inc';
install_goto('install.php');
include_once DRUPAL_ROOT . '/core/includes/install.inc';
install_goto('core/install.php');
}
// The user agent header is used to pass a database prefix in the request when
......@@ -2369,7 +2377,7 @@ 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 . '/includes/database/database.inc';
require_once DRUPAL_ROOT . '/core/includes/database/database.inc';
// Register autoload functions so that we can access classes and interfaces.
// The database autoload routine comes first so that we can load the database
......@@ -2386,13 +2394,13 @@ function _drupal_bootstrap_variables() {
global $conf;
// Initialize the lock system.
require_once DRUPAL_ROOT . '/' . variable_get('lock_inc', 'includes/lock.inc');
require_once DRUPAL_ROOT . '/' . variable_get('lock_inc', 'core/includes/lock.inc');
lock_initialize();
// 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 . '/includes/module.inc';
require_once DRUPAL_ROOT . '/core/includes/module.inc';
module_load_all(TRUE);
}
......@@ -2484,7 +2492,7 @@ function drupal_generate_test_ua($prefix) {
* @see _drupal_maintenance_theme()
*/
function drupal_maintenance_theme() {
require_once DRUPAL_ROOT . '/includes/theme.maintenance.inc';
require_once DRUPAL_ROOT . '/core/includes/theme.maintenance.inc';
_drupal_maintenance_theme();
}
......@@ -2574,7 +2582,7 @@ function drupal_language_initialize() {
$GLOBALS[$type] = $default;
}
if (drupal_multilingual()) {
include_once DRUPAL_ROOT . '/includes/language.inc';
include_once DRUPAL_ROOT . '/core/includes/language.inc';
foreach ($types as $type) {
$GLOBALS[$type] = language_initialize($type);
}
......@@ -2930,7 +2938,7 @@ function drupal_get_complete_schema($rebuild = FALSE) {
module_load_all_includes('install');
}
require_once DRUPAL_ROOT . '/includes/common.inc';
require_once DRUPAL_ROOT . '/core/includes/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
......@@ -3099,7 +3107,7 @@ function registry_rebuild() {
* @see registry_rebuild()
*/
function registry_update() {
require_once DRUPAL_ROOT . '/includes/registry.inc';
require_once DRUPAL_ROOT . '/core/includes/registry.inc';
_registry_update();
}
......@@ -3341,7 +3349,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 . '/includes/errors.inc';
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
if (error_displayable()) {
print '<h1>Uncaught exception thrown in shutdown function.</h1>';
print '<p>' . _drupal_render_exception_safe($exception) . '</p><hr />';
......
......@@ -1539,7 +1539,7 @@ function filter_xss_bad_protocol($string, $decode = TRUE) {
// string that needs decoding.
if ($decode) {
if (!function_exists('decode_entities')) {
require_once DRUPAL_ROOT . '/includes/unicode.inc';
require_once DRUPAL_ROOT . '/core/includes/unicode.inc';
}
$string = decode_entities($string);
......@@ -2768,9 +2768,9 @@ function drupal_add_html_head_link($attributes, $header = FALSE) {
* - 'basename': Force a basename for the file being added. Modules are
* expected to use stylesheets with unique filenames, but integration of
* external libraries may make this impossible. The basename of
* 'modules/node/node.css' is 'node.css'. If the external library "node.js"
* ships with a 'node.css', then a different, unique basename would be
* 'node.js.css'.
* 'core/modules/node/node.css' is 'node.css'. If the external library
* "node.js" ships with a 'node.css', then a different, unique basename
* would be 'node.js.css'.
* - 'group': A number identifying the group in which to add the stylesheet.
* Available constants are:
* - CSS_SYSTEM: Any system-layer CSS.
......@@ -3808,8 +3808,8 @@ function drupal_region_class($region) {
*
* Examples:
* @code
* drupal_add_js('misc/collapse.js');
* drupal_add_js('misc/collapse.js', 'file');
* drupal_add_js('core/misc/collapse.js');
* drupal_add_js('core/misc/collapse.js', 'file');
* drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });', 'inline');
* drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });',
* array('type' => 'inline', 'scope' => 'footer', 'weight' => 5)
......@@ -3970,8 +3970,8 @@ function drupal_add_js($data = NULL, $options = NULL) {
'every_page' => TRUE,
'weight' => 0,
),
'misc/drupal.js' => array(
'data' => 'misc/drupal.js',
'core/misc/drupal.js' => array(
'data' => 'core/misc/drupal.js',
'type' => 'file',
'scope' => 'header',
'group' => JS_LIBRARY,
......@@ -4692,7 +4692,7 @@ function drupal_add_tabledrag($table_id, $action, $relationship, $group, $subgro
// to ensure that table drag behaviors are registered before any module
// uses it.
drupal_add_library('system', 'jquery.cookie');
drupal_add_js('misc/tabledrag.js', array('weight' => -1));
drupal_add_js('core/misc/tabledrag.js', array('weight' => -1));
$js_added = TRUE;
}
......@@ -4889,20 +4889,20 @@ function _drupal_bootstrap_full() {
return;
}
$called = TRUE;
require_once DRUPAL_ROOT . '/' . variable_get('path_inc', 'includes/path.inc');
require_once DRUPAL_ROOT . '/includes/theme.inc';
require_once DRUPAL_ROOT . '/includes/pager.inc';
require_once DRUPAL_ROOT . '/' . variable_get('menu_inc', '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';
require_once DRUPAL_ROOT . '/includes/ajax.inc';
require_once DRUPAL_ROOT . '/includes/token.inc';
require_once DRUPAL_ROOT . '/includes/errors.inc';
require_once DRUPAL_ROOT . '/' . variable_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 . '/' . variable_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/actions.inc';
require_once DRUPAL_ROOT . '/core/includes/ajax.inc';
require_once DRUPAL_ROOT . '/core/includes/token.inc';
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
// Detect string handling method
unicode_check();
......@@ -5112,7 +5112,7 @@ function drupal_cron_cleanup() {
* The preg_match() regular expression for the files to find.
* @param string $directory
* The subdirectory name in which the files are found. For example,
* 'modules' will search in sub-directories of the top-level /modules
* 'core/modules' will search in sub-directories of the /core/modules
* directory, sub-directories of /sites/all/modules/, etc.
* @param string $key
* The key to be used for the associative array returned. Possible values are
......@@ -5122,7 +5122,8 @@ function drupal_cron_cleanup() {
* @param int $min_depth
* Minimum depth of directories to return files from, relative to each
* directory searched. For instance, a minimum depth of 2 would find modules
* inside /modules/node/tests, but not modules directly in /modules/node.
* inside /core/modules/node/tests, but not modules directly in
* /core/modules/node.
*
* @return array
* An associative array of file objects, keyed on the chosen key. Each element
......@@ -5133,16 +5134,16 @@ function drupal_cron_cleanup() {
*/
function drupal_system_listing($mask, $directory, $key = 'name', $min_depth = 1) {
$config = conf_path();
$profile = drupal_get_profile();
$searchdir = array($directory);
$files = array();
// Search for the directory in core.
$searchdir = array('core/' . $directory);
// The 'profiles' directory contains pristine collections of modules and
// themes as organized by a distribution. It is pristine in the same way
// that /modules is pristine for core; users should avoid changing anything
// there in favor of sites/all or sites/<domain> directories.
// themes as provided by a distribution. It is pristine in the same way that
// the 'core/modules' directory is pristine for core; users should avoid
// any modification by using the sites/all or sites/<domain> directories.
$profile = drupal_get_profile();
if (file_exists("profiles/$profile/$directory")) {
$searchdir[] = "profiles/$profile/$directory";
}
......@@ -5156,7 +5157,7 @@ function drupal_system_listing($mask, $directory, $key = 'name', $min_depth = 1)
// Get current list of items
if (!function_exists('file_scan_directory')) {
require_once DRUPAL_ROOT . '/includes/file.inc';
require_once DRUPAL_ROOT . '/core/includes/file.inc';
}
foreach ($searchdir as $dir) {
$files_to_add = file_scan_directory($dir, $mask, array('key' => $key, 'min_depth' => $min_depth));
......@@ -7314,7 +7315,7 @@ function drupal_check_incompatibility($v, $current_version) {
* failed. See xmlrpc_error().
*/
function xmlrpc($url, $args, $options = array()) {
require_once DRUPAL_ROOT . '/includes/xmlrpc.inc';
require_once DRUPAL_ROOT . '/core/includes/xmlrpc.inc';
return _xmlrpc($url, $args, $options);
}
......
......@@ -1659,7 +1659,7 @@ public static function addConnectionInfo($key, $target, $info) {
// We cannot rely on the registry yet, because the registry requires an
// open database connection.
$driver_class = 'DatabaseConnection_' . $driver;
require_once DRUPAL_ROOT . '/includes/database/' . $driver . '/database.inc';
require_once DRUPAL_ROOT . '/core/includes/database/' . $driver . '/database.inc';
$new_connection = new $driver_class(self::$databaseInfo[$key][$target]);
$new_connection->setTarget($target);
$new_connection->setKey($key);
......
......@@ -268,7 +268,8 @@ function prefixNonTable($table) {
* method should be overwritten by a database driver if the database provider
* uses alternate methods. Because information_schema.tables is used in a few
* different functions, a database driver will only need to override this function
* to make all the others work. For example see includes/databases/mysql/schema.inc.
* to make all the others work. For example see
* core/includes/databases/mysql/schema.inc.
*
* @param $table_name
* The name of the table in question.
......
......@@ -10,7 +10,7 @@
* @{
*/
include_once DRUPAL_ROOT . '/includes/database/prefetch.inc';
include_once DRUPAL_ROOT . '/core/includes/database/prefetch.inc';
/**
* Specific SQLite implementation of DatabaseConnection.
......
......@@ -70,7 +70,7 @@ function _drupal_error_handler_real($error_level, $message, $filename, $line, $c
$caller = _drupal_get_last_caller(debug_backtrace());
if (!function_exists('filter_xss_admin')) {
require_once DRUPAL_ROOT . '/includes/common.inc';
require_once DRUPAL_ROOT . '/core/includes/common.inc';
}
// We treat recoverable errors as fatal.
......
......@@ -12,7 +12,7 @@
* File API is needed before a bootstrap, or in an alternate order (e.g.
* maintenance theme).
*/
require_once DRUPAL_ROOT . '/includes/stream_wrappers.inc';
require_once DRUPAL_ROOT . '/core/includes/stream_wrappers.inc';
/**
* @defgroup file File interface
......
......@@ -3221,7 +3221,7 @@ function theme_tableselect($variables) {
// checkboxes/radios in the first table column.
if ($element['#js_select']) {
// Add a "Select all" checkbox.
drupal_add_js('misc/tableselect.js');
drupal_add_js('core/misc/tableselect.js');
array_unshift($header, array('class' => array('select-all')));
}
else {
......@@ -3388,7 +3388,7 @@ function form_process_machine_name($element, &$form_state) {
),
),
);
$element['#attached']['js'][] = 'misc/machine-name.js';
$element['#attached']['js'][] = 'core/misc/machine-name.js';
$element['#attached']['js'][] = $js_settings;
return $element;
......@@ -4375,7 +4375,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 . '/includes/batch.inc';
require_once DRUPAL_ROOT . '/core/includes/batch.inc';
_batch_process();
}
}
......@@ -4444,8 +4444,8 @@ function _batch_queue($batch_set) {
// sure the files are manually included.
if (!isset($queues)) {
$queues = array();
require_once DRUPAL_ROOT . '/modules/system/system.queue.inc';
require_once DRUPAL_ROOT . '/includes/batch.queue.inc';
require_once DRUPAL_ROOT . '/core/modules/system/system.queue.inc';
require_once DRUPAL_ROOT . '/core/includes/batch.queue.inc';
}
if (isset($batch_set['queue'])) {
......
This diff is collapsed.
......@@ -212,7 +212,7 @@ function drupal_install_profile_distribution_name() {
* @return
* The auto-detected $base_url that should be configured in settings.php
*/
function drupal_detect_baseurl($file = 'install.php') {
function drupal_detect_baseurl($file = 'core/install.php') {
$proto = $_SERVER['HTTPS'] ? 'https://' : 'http://';
$host = $_SERVER['SERVER_NAME'];
$port = ($_SERVER['SERVER_PORT'] == 80 ? '' : ':' . $_SERVER['SERVER_PORT']);
......@@ -247,13 +247,13 @@ function drupal_detect_database_types() {
function drupal_get_database_types() {
$databases = array();
// We define a driver as a directory in /includes/database that in turn
// 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.
// Because we have no registry yet, we need to also include the install.inc
// file for the driver explicitly.
require_once DRUPAL_ROOT . '/includes/database/database.inc';
foreach (file_scan_directory(DRUPAL_ROOT . '/includes/database', '/^[a-z]*$/i', array('recurse' => FALSE)) as $file) {
require_once DRUPAL_ROOT . '/core/includes/database/database.inc';
foreach (file_scan_directory(DRUPAL_ROOT . '/core/includes/database', '/^[a-z]*$/i', array('recurse' => FALSE)) as $file) {
if (file_exists($file->uri . '/database.inc') && file_exists($file->uri . '/install.inc')) {
$drivers[$file->filename] = $file->uri;
}
......@@ -665,8 +665,8 @@ function drupal_verify_profile($install_state) {
$profile = $install_state['parameters']['profile'];
$locale = $install_state['parameters']['locale'];
include_once DRUPAL_ROOT . '/includes/file.inc';
include_once DRUPAL_ROOT . '/includes/common.inc';
include_once DRUPAL_ROOT . '/core/includes/file.inc';
include_once DRUPAL_ROOT . '/core/includes/common.inc';
$profile_file = DRUPAL_ROOT . "/profiles/$profile/$profile.profile";
......@@ -1009,7 +1009,7 @@ function drupal_install_fix_file($file, $mask, $message = TRUE) {
*/
function install_goto($path) {
global $base_url;
include_once DRUPAL_ROOT . '/includes/common.inc';
include_once DRUPAL_ROOT . '/core/includes/common.inc';
header('Location: ' . $base_url . '/' . $path);
header('Cache-Control: no-cache'); // Not a permanent redirect.
drupal_exit();
......@@ -1108,7 +1108,7 @@ function st($string, array $args = array(), array $options = array()) {
// that multiple files end with the same extension, even if unlikely.
$locale_files = install_find_locale_files($install_state['parameters']['locale']);
if (!empty($locale_files)) {
require_once DRUPAL_ROOT . '/includes/gettext.inc';
require_once DRUPAL_ROOT . '/core/includes/gettext.inc';
foreach ($locale_files as $locale_file) {
_locale_import_read_po('mem-store', $locale_file);
}
......@@ -1117,7 +1117,7 @@ function st($string, array $args = array(), array $options = array()) {
}
}
require_once DRUPAL_ROOT . '/includes/theme.inc';
require_once DRUPAL_ROOT . '/core/includes/theme.inc';
// Transform arguments before inserting them
foreach ($args as $key => $value) {
switch ($key[0]) {
......@@ -1146,7 +1146,7 @@ function st($string, array $args = array(), array $options = array()) {
* Array of the install profile's requirements.
*/
function drupal_check_profile($profile) {
include_once DRUPAL_ROOT . '/includes/file.inc';
include_once DRUPAL_ROOT . '/core/includes/file.inc';
$profile_file = DRUPAL_ROOT . "/profiles/$profile/$profile.profile";
......
......@@ -516,7 +516,7 @@ function locale_language_save($language) {
// If name was not set, we add a predefined language.
if (!isset($language->name)) {
include_once DRUPAL_ROOT . '/includes/standard.inc';
include_once DRUPAL_ROOT . '/core/includes/standard.inc';
$predefined = standard_language_list();
$language->name = $predefined[$language->language][0];
$language->direction = isset($predefined[$language->language][2]) ? $predefined[$language->language][2] : LANGUAGE_LTR;
......@@ -859,7 +859,7 @@ function _locale_rebuild_js($langcode = NULL) {
* Prepares the language code list for a select form item with only the unsupported ones
*/
function _locale_prepare_predefined_list() {
include_once DRUPAL_ROOT . '/includes/standard.inc';
include_once DRUPAL_ROOT . '/core/includes/standard.inc';
$languages = language_list();
$predefined = standard_language_list();
foreach ($predefined as $key => $value) {
......@@ -884,7 +884,7 @@ function _locale_prepare_predefined_list() {
* An array of all country code => country name pairs.
*/
function country_get_list() {
include_once DRUPAL_ROOT . '/includes/standard.inc';
include_once DRUPAL_ROOT . '/core/includes/standard.inc';
$countries = standard_country_list();
// Allow other modules to modify the country list.
drupal_alter('countries', $countries);
......
......@@ -214,7 +214,7 @@ function system_list_reset() {
* without this module.
*/
function _module_build_dependencies($files) {
require_once DRUPAL_ROOT . '/includes/graph.inc';
require_once DRUPAL_ROOT . '/core/includes/graph.inc';
foreach ($files as $filename => $file) {
$graph[$file->name]['edges'] = array();
if (isset($file->info['dependencies']) && is_array($file->info['dependencies'])) {
......@@ -258,7 +258,7 @@ function module_exists($module) {
*/
function module_load_install($module) {
// Make sure the installation API is available
include_once DRUPAL_ROOT . '/includes/install.inc';
include_once DRUPAL_ROOT . '/core/includes/install.inc';
return module_load_include('install', $module);
}
......@@ -391,7 +391,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
}
// Required for module installation checks.
include_once DRUPAL_ROOT . '/includes/install.inc';
include_once DRUPAL_ROOT . '/core/includes/install.inc';
$modules_installed = array();
$modules_enabled = array();
......
......@@ -29,9 +29,9 @@ function _registry_update() {
// registry rebuild process runs.
$connection_info = Database::getConnectionInfo();
$driver = $connection_info['default']['driver'];
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';
require_once DRUPAL_ROOT . '/core/includes/database/query.inc';
require_once DRUPAL_ROOT . '/core/includes/database/select.inc';
require_once DRUPAL_ROOT . '/core/includes/database/' . $driver . '/query.inc';
// Get current list of modules and their files.
$modules = db_query("SELECT * FROM {system} WHERE type = 'module'")->fetchAll();
......@@ -51,7 +51,7 @@ function _registry_update() {
}
}
}
foreach (file_scan_directory('includes', '/\.inc$/') as $filename => $file) {
foreach (file_scan_directory('core/includes', '/\.inc$/') as $filename => $file) {
$files["$filename"] = array('module' => '', 'weight' => 0);
}
......
......@@ -219,7 +219,7 @@ function _drupal_session_write($sid, $value) {
return TRUE;
}
catch (Exception $exception) {
require_once DRUPAL_ROOT . '/includes/errors.inc';
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
// If we are displaying errors, then do so with no possibility of a further
// uncaught exception being thrown.
if (error_displayable()) {
......
......@@ -312,7 +312,7 @@ static function getMimeType($uri, $mapping = NULL) {
if (!isset($mapping)) {
// The default file map, defined in file.mimetypes.inc is quite big.
// We only load it when necessary.