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
|
@ -13,6 +13,7 @@ use Drupal\Component\Utility\Unicode;
|
|||
use Drupal\Core\DrupalKernel;
|
||||
use Drupal\Core\Extension\ExtensionDiscovery;
|
||||
use Drupal\Core\Logger\RfcLogLevel;
|
||||
use Drupal\Core\Render\Markup;
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
use Drupal\Core\Site\Settings;
|
||||
use Drupal\Core\Utility\Error;
|
||||
|
@ -101,13 +102,27 @@ const DRUPAL_PHP_FUNCTION_PATTERN = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*';
|
|||
* $config_directories key for active directory.
|
||||
*
|
||||
* @see config_get_config_directory()
|
||||
*
|
||||
* @deprecated in Drupal 8.0.x and will be removed before 9.0.0. Drupal core no
|
||||
* longer creates an active directory.
|
||||
*/
|
||||
const CONFIG_ACTIVE_DIRECTORY = 'active';
|
||||
|
||||
/**
|
||||
* $config_directories key for sync directory.
|
||||
*
|
||||
* @see config_get_config_directory()
|
||||
*/
|
||||
const CONFIG_SYNC_DIRECTORY = 'sync';
|
||||
|
||||
/**
|
||||
* $config_directories key for staging directory.
|
||||
*
|
||||
* @see config_get_config_directory()
|
||||
* @see CONFIG_SYNC_DIRECTORY
|
||||
*
|
||||
* @deprecated in Drupal 8.0.x and will be removed before 9.0.0. The staging
|
||||
* directory was renamed to sync.
|
||||
*/
|
||||
const CONFIG_STAGING_DIRECTORY = 'staging';
|
||||
|
||||
|
@ -118,60 +133,29 @@ const CONFIG_STAGING_DIRECTORY = 'staging';
|
|||
*/
|
||||
define('DRUPAL_ROOT', dirname(dirname(__DIR__)));
|
||||
|
||||
/**
|
||||
* Returns the appropriate configuration directory.
|
||||
*
|
||||
* @param bool $require_settings
|
||||
* Only configuration directories with an existing settings.php file
|
||||
* will be recognized. Defaults to TRUE. During initial installation,
|
||||
* this is set to FALSE so that Drupal can detect a matching directory,
|
||||
* then create a new settings.php file in it.
|
||||
* @param bool $reset
|
||||
* Force a full search for matching directories even if one had been
|
||||
* found previously. Defaults to FALSE.
|
||||
* @param \Symfony\Component\HttpFoundation\Request $request
|
||||
* (optional) The current request. Defaults to \Drupal::request() or a new
|
||||
* request created from globals.
|
||||
*
|
||||
* @return string
|
||||
* The path of the matching directory.@see default.settings.php
|
||||
*
|
||||
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
|
||||
* Use \Drupal\Core\DrupalKernel::getSitePath() instead. If the kernel is
|
||||
* unavailable or the site path needs to be recalculated then
|
||||
* Drupal\Core\DrupalKernel::findSitePath() can be used.
|
||||
*/
|
||||
function conf_path($require_settings = TRUE, $reset = FALSE, Request $request = NULL) {
|
||||
if (!isset($request)) {
|
||||
if (\Drupal::hasRequest()) {
|
||||
$request = \Drupal::request();
|
||||
}
|
||||
// @todo Remove once external CLI scripts (Drush) are updated.
|
||||
else {
|
||||
$request = Request::createFromGlobals();
|
||||
}
|
||||
}
|
||||
if (\Drupal::hasService('kernel')) {
|
||||
$site_path = \Drupal::service('kernel')->getSitePath();
|
||||
}
|
||||
if (!isset($site_path) || empty($site_path)) {
|
||||
$site_path = DrupalKernel::findSitePath($request, $require_settings);
|
||||
}
|
||||
return $site_path;
|
||||
}
|
||||
/**
|
||||
* Returns the path of a configuration directory.
|
||||
*
|
||||
* Configuration directories are configured using $config_directories in
|
||||
* settings.php.
|
||||
*
|
||||
* @param string $type
|
||||
* (optional) The type of config directory to return. Drupal core provides
|
||||
* 'active' and 'staging'. Defaults to CONFIG_ACTIVE_DIRECTORY.
|
||||
* The type of config directory to return. Drupal core provides the
|
||||
* CONFIG_SYNC_DIRECTORY constant to access the sync directory.
|
||||
*
|
||||
* @return string
|
||||
* The configuration directory path.
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
function config_get_config_directory($type = CONFIG_ACTIVE_DIRECTORY) {
|
||||
function config_get_config_directory($type) {
|
||||
global $config_directories;
|
||||
|
||||
// @todo Remove fallback in Drupal 9. https://www.drupal.org/node/2574943
|
||||
if ($type == CONFIG_SYNC_DIRECTORY && !isset($config_directories[CONFIG_SYNC_DIRECTORY]) && isset($config_directories[CONFIG_STAGING_DIRECTORY])) {
|
||||
$type = CONFIG_STAGING_DIRECTORY;
|
||||
}
|
||||
|
||||
if (!empty($config_directories[$type])) {
|
||||
return $config_directories[$type];
|
||||
}
|
||||
|
@ -305,7 +289,7 @@ function drupal_get_path($type, $name) {
|
|||
* names or link URLs into translated text. Variable substitution looks like
|
||||
* this:
|
||||
* @code
|
||||
* $text = t("@name's blog", array('@name' => user_format_name($account)));
|
||||
* $text = t("@name's blog", array('@name' => $account->getDisplayName()));
|
||||
* @endcode
|
||||
* Basically, you can put variables like @name into your string, and t() will
|
||||
* substitute their sanitized values at translation time. (See the
|
||||
|
@ -435,7 +419,7 @@ function watchdog_exception($type, Exception $exception, $message = NULL, $varia
|
|||
* drupal_set_message(t('An error occurred and processing did not complete.'), 'error');
|
||||
* @endcode
|
||||
*
|
||||
* @param string|\Drupal\Component\Utility\SafeStringInterface $message
|
||||
* @param string|\Drupal\Component\Render\MarkupInterface $message
|
||||
* (optional) The translated message to be displayed to the user. For
|
||||
* consistency with other messages, it should begin with a capital letter and
|
||||
* end with a period.
|
||||
|
@ -482,13 +466,13 @@ function drupal_set_message($message = NULL, $type = 'status', $repeat = FALSE)
|
|||
$_SESSION['messages'][$type] = array();
|
||||
}
|
||||
|
||||
// Convert strings which are in the safe markup list to SafeString objects.
|
||||
if (is_string($message) && SafeMarkup::isSafe($message)) {
|
||||
$message = \Drupal\Core\Render\SafeString::create($message);
|
||||
// Convert strings which are safe to the simplest Markup objects.
|
||||
if (!($message instanceof Markup) && SafeMarkup::isSafe($message)) {
|
||||
$message = Markup::create((string) $message);
|
||||
}
|
||||
|
||||
// Do not use strict type checking so that equivalent string and
|
||||
// SafeStringInterface objects are detected.
|
||||
// MarkupInterface objects are detected.
|
||||
if ($repeat || !in_array($message, $_SESSION['messages'][$type])) {
|
||||
$_SESSION['messages'][$type][] = $message;
|
||||
}
|
||||
|
|
Reference in a new issue