updated core to 8.6.3

This commit is contained in:
2018-11-21 12:49:46 +01:00
parent 8ca34853a3
commit c92c348eee
521 changed files with 12199 additions and 4578 deletions
+10 -6
View File
@@ -572,14 +572,14 @@ function drupal_get_user_timezone() {
* @param $message
* The error message.
* @param $filename
* The filename that the error was raised in.
* (optional) The filename that the error was raised in.
* @param $line
* The line number the error was raised at.
* (optional) The line number the error was raised at.
* @param $context
* An array that points to the active symbol table at the point the error
* occurred.
* (optional) 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) {
function _drupal_error_handler($error_level, $message, $filename = NULL, $line = NULL, $context = NULL) {
require_once __DIR__ . '/errors.inc';
_drupal_error_handler_real($error_level, $message, $filename, $line, $context);
}
@@ -1033,8 +1033,12 @@ function _drupal_shutdown_function() {
chdir(DRUPAL_ROOT);
try {
foreach ($callbacks as &$callback) {
reset($callbacks);
// Do not use foreach() here because it is possible that the callback will
// add to the $callbacks array via drupal_register_shutdown_function().
while ($callback = current($callbacks)) {
call_user_func_array($callback['callback'], $callback['arguments']);
next($callbacks);
}
}
// PHP 7 introduces Throwable, which covers both Error and
+16 -7
View File
@@ -1270,12 +1270,19 @@ function install_select_profile(&$install_state) {
/**
* Determines the installation profile to use in the installer.
*
* A profile will be selected in the following order of conditions:
* Depending on the context from which it's being called, this method
* may be used to:
* - Automatically select a profile under certain conditions.
* - Indicate which profile has already been selected.
* - Indicate that a profile still needs to be selected.
*
* A profile will be selected automatically if one of the following conditions
* is met. They are checked in the given order:
* - Only one profile is available.
* - A specific profile name is requested in installation parameters:
* - For interactive installations via request query parameters.
* - For non-interactive installations via install_drupal() settings.
* - A discovered profile that is a distribution. If multiple profiles are
* - One of the available profiles is a distribution. If multiple profiles are
* distributions, then the first discovered profile will be selected.
* - Only one visible profile is available.
*
@@ -1283,35 +1290,37 @@ function install_select_profile(&$install_state) {
* The current installer state, containing a 'profiles' key, which is an
* associative array of profiles with the machine-readable names as keys.
*
* @return
* @return string|null
* The machine-readable name of the selected profile or NULL if no profile was
* selected.
*
* @see install_select_profile()
*/
function _install_select_profile(&$install_state) {
// Don't need to choose profile if only one available.
// If there is only one profile available it will always be the one selected.
if (count($install_state['profiles']) == 1) {
return key($install_state['profiles']);
}
// If a valid profile has already been selected, return the selection.
if (!empty($install_state['parameters']['profile'])) {
$profile = $install_state['parameters']['profile'];
if (isset($install_state['profiles'][$profile])) {
return $profile;
}
}
// Check for a distribution profile.
// If any of the profiles are distribution profiles, return the first one.
foreach ($install_state['profiles'] as $profile) {
$profile_info = install_profile_info($profile->getName());
if (!empty($profile_info['distribution'])) {
return $profile->getName();
}
}
// Get all visible (not hidden) profiles.
$visible_profiles = array_filter($install_state['profiles'], function ($profile) {
$profile_info = install_profile_info($profile->getName());
return !isset($profile_info['hidden']) || !$profile_info['hidden'];
});
// If there is only one visible profile, return it.
if (count($visible_profiles) == 1) {
return (key($visible_profiles));
}
+17
View File
@@ -11,6 +11,7 @@ use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\OpCodeCache;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Extension\ExtensionDiscovery;
use Drupal\Core\Extension\ModuleHandler;
use Drupal\Core\Site\Settings;
/**
@@ -990,6 +991,12 @@ function drupal_check_profile($profile) {
}
}
// Add the profile requirements.
$function = $profile . '_requirements';
if (function_exists($function)) {
$requirements = array_merge($requirements, $function('install'));
}
return $requirements;
}
@@ -1113,6 +1120,16 @@ function install_profile_info($profile, $langcode = 'en') {
$info = \Drupal::service('info_parser')->parse("$profile_path/$profile.info.yml");
$info += $defaults;
// Convert dependencies in [project:module] format.
$info['dependencies'] = array_map(function ($dependency) {
return ModuleHandler::parseDependency($dependency)['name'];
}, $info['dependencies']);
// Convert install key in [project:module] format.
$info['install'] = array_map(function ($dependency) {
return ModuleHandler::parseDependency($dependency)['name'];
}, $info['install']);
// drupal_required_modules() includes the current profile as a dependency.
// Remove that dependency, since a module cannot depend on itself.
$required = array_diff(drupal_required_modules(), [$profile]);