Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663
This commit is contained in:
parent
eb34d130a8
commit
f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions
core/lib/Drupal/Core
|
@ -992,47 +992,32 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
|
|||
* @todo D8: Eliminate this entirely in favor of Request object.
|
||||
*/
|
||||
protected function initializeRequestGlobals(Request $request) {
|
||||
// Provided by settings.php.
|
||||
global $base_url;
|
||||
// Set and derived from $base_url by this function.
|
||||
global $base_path, $base_root;
|
||||
global $base_secure_url, $base_insecure_url;
|
||||
|
||||
// @todo Refactor with the Symfony Request object.
|
||||
if (isset($base_url)) {
|
||||
// Parse fixed base URL from settings.php.
|
||||
$parts = parse_url($base_url);
|
||||
if (!isset($parts['path'])) {
|
||||
$parts['path'] = '';
|
||||
}
|
||||
$base_path = $parts['path'] . '/';
|
||||
// Build $base_root (everything until first slash after "scheme://").
|
||||
$base_root = substr($base_url, 0, strlen($base_url) - strlen($parts['path']));
|
||||
}
|
||||
else {
|
||||
// Create base URL.
|
||||
$base_root = $request->getSchemeAndHttpHost();
|
||||
// Create base URL.
|
||||
$base_root = $request->getSchemeAndHttpHost();
|
||||
$base_url = $base_root;
|
||||
|
||||
$base_url = $base_root;
|
||||
|
||||
// For a request URI of '/index.php/foo', $_SERVER['SCRIPT_NAME'] is
|
||||
// '/index.php', whereas $_SERVER['PHP_SELF'] is '/index.php/foo'.
|
||||
if ($dir = rtrim(dirname($request->server->get('SCRIPT_NAME')), '\/')) {
|
||||
// Remove "core" directory if present, allowing install.php,
|
||||
// authorize.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 .= '/';
|
||||
// For a request URI of '/index.php/foo', $_SERVER['SCRIPT_NAME'] is
|
||||
// '/index.php', whereas $_SERVER['PHP_SELF'] is '/index.php/foo'.
|
||||
if ($dir = rtrim(dirname($request->server->get('SCRIPT_NAME')), '\/')) {
|
||||
// Remove "core" directory if present, allowing install.php,
|
||||
// authorize.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 = '/';
|
||||
$base_path = $dir;
|
||||
}
|
||||
$base_url .= $base_path;
|
||||
$base_path .= '/';
|
||||
}
|
||||
else {
|
||||
$base_path = '/';
|
||||
}
|
||||
$base_secure_url = str_replace('http://', 'https://', $base_url);
|
||||
$base_insecure_url = str_replace('https://', 'http://', $base_url);
|
||||
|
|
Reference in a new issue