Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
Drupal core 7.67
Browse files Browse the repository at this point in the history
  • Loading branch information
olofbokedal committed May 27, 2019
1 parent f1717c1 commit 98f60f9
Show file tree
Hide file tree
Showing 163 changed files with 2,169 additions and 577 deletions.
2 changes: 1 addition & 1 deletion public/includes/bootstrap.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* The current system version.
*/
define('VERSION', '7.66');
define('VERSION', '7.67');

/**
* Core API compatibility.
Expand Down
18 changes: 1 addition & 17 deletions public/includes/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,6 @@ function drupal_get_profile() {
return $profile;
}

/**
* Returns a list of related install profiles in decending order of their
* dependencies.
*/
function drupal_get_profiles() {
global $install_state;

if (isset($install_state['parameters']['profile'])) {
$profiles = install_get_base_profiles();
}
else {
$profiles = variable_get('install_profiles', array('standard'));
}

return $profiles;
}

/**
* Sets the breadcrumb trail for the current page.
Expand Down Expand Up @@ -5582,7 +5566,7 @@ function drupal_system_listing($mask, $directory, $key = 'name', $min_depth = 1)
}
// In case both profile directories contain the same extension, the actual
// profile always has precedence.
$profiles = array_merge($profiles, drupal_get_profiles());
$profiles[] = $profile;
foreach ($profiles as $profile) {
if (file_exists("profiles/$profile/$directory")) {
$searchdir[] = "profiles/$profile/$directory";
Expand Down
14 changes: 14 additions & 0 deletions public/includes/file.phar.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,21 @@ function file_register_phar_wrapper() {
include_once $directory . '/Helper.php';
include_once $directory . '/Manager.php';
include_once $directory . '/PharStreamWrapper.php';
include_once $directory . '/Collectable.php';
include_once $directory . '/Interceptor/ConjunctionInterceptor.php';
include_once $directory . '/Interceptor/PharMetaDataInterceptor.php';
include_once $directory . '/Phar/Container.php';
include_once $directory . '/Phar/DeserializationException.php';
include_once $directory . '/Phar/Manifest.php';
include_once $directory . '/Phar/Reader.php';
include_once $directory . '/Phar/ReaderException.php';
include_once $directory . '/Phar/Stub.php';
include_once $directory . '/Resolvable.php';
include_once $directory . '/Resolver/PharInvocation.php';
include_once $directory . '/Resolver/PharInvocationCollection.php';
include_once $directory . '/Resolver/PharInvocationResolver.php';
include_once DRUPAL_ROOT . '/misc/typo3/drupal-security/PharExtensionInterceptor.php';
include_once DRUPAL_ROOT . '/misc/brumann/polyfill-unserialize/src/Unserialize.php';

// Set up a stream wrapper to handle insecurities due to PHP's built-in
// phar stream wrapper.
Expand Down
88 changes: 26 additions & 62 deletions public/includes/install.core.inc
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ function install_state_defaults() {
// An array of information about the chosen installation profile. This will
// be filled in based on the profile's .info file.
'profile_info' => array(),
// An array of information for each of the base profiles of the chosen
// install profile.
'base_profiles_info' => array(),
// An array of available installation profiles.
'profiles' => array(),
// An array of server variables that will be substituted into the global
Expand Down Expand Up @@ -577,17 +574,15 @@ function install_tasks($install_state) {
if (!empty($install_state['parameters']['profile'])) {
// Load the profile install file, because it is not always loaded when
// hook_install_tasks() is invoked (e.g. batch processing).
foreach (drupal_get_profiles() as $profile) {
$profile_install_file = DRUPAL_ROOT . "/profiles/$profile/$profile.install";
if (file_exists($profile_install_file)) {
include_once $profile_install_file;
}
$function = $profile . '_install_tasks';
if (function_exists($function)) {
$result = $function($install_state);
if (is_array($result)) {
$tasks += $result;
}
$profile_install_file = DRUPAL_ROOT . '/profiles/' . $install_state['parameters']['profile'] . '/' . $install_state['parameters']['profile'] . '.install';
if (file_exists($profile_install_file)) {
include_once $profile_install_file;
}
$function = $install_state['parameters']['profile'] . '_install_tasks';
if (function_exists($function)) {
$result = $function($install_state);
if (is_array($result)) {
$tasks += $result;
}
}
}
Expand All @@ -607,14 +602,12 @@ function install_tasks($install_state) {

// Allow the installation profile to modify the full list of tasks.
if (!empty($install_state['parameters']['profile'])) {
foreach (drupal_get_profiles() as $profile) {
$profile_file = DRUPAL_ROOT . "/profiles/$profile/$profile.profile";
if (file_exists($profile_file)) {
include_once $profile_file;
$function = $profile . '_install_tasks_alter';
if (function_exists($function)) {
$function($tasks, $install_state);
}
$profile_file = DRUPAL_ROOT . '/profiles/' . $install_state['parameters']['profile'] . '/' . $install_state['parameters']['profile'] . '.profile';
if (file_exists($profile_file)) {
include_once $profile_file;
$function = $install_state['parameters']['profile'] . '_install_tasks_alter';
if (function_exists($function)) {
$function($tasks, $install_state);
}
}
}
Expand Down Expand Up @@ -808,19 +801,11 @@ function install_system_module(&$install_state) {

// Save the list of other modules to install for the upcoming tasks.
// variable_set() can be used now that system.module is installed.
$profiles = drupal_get_profiles();
$profile_dependencies = array();

foreach ($profiles as $profile) {
$info = install_profile_info($profile);
$profile_dependencies = array_unique(array_merge($profile_dependencies, $info['dependencies']));
}

$modules = $profile_dependencies;
$modules = $install_state['profile_info']['dependencies'];

// The installation profile is also a module, which needs to be installed
// after all the dependencies have been installed.
$modules = array_merge($modules, $profiles);
$modules[] = drupal_get_profile();

variable_set('install_profile_modules', array_diff($modules, array('system')));
$install_state['database_tables_exist'] = TRUE;
Expand Down Expand Up @@ -1246,15 +1231,8 @@ function install_find_locales($profilename) {
*/
function install_select_locale(&$install_state) {
// Find all available locales.
$locales = array();
$profilename = $install_state['parameters']['profile'];

// @todo remove duplicate 'en' languages from install_find_locales() to avoid
// polluting the 'locales' install state key.
foreach (drupal_get_profiles() as $profile) {
$locales = array_merge($locales, install_find_locales($profile));
}

$locales = install_find_locales($profilename);
$install_state['locales'] += $locales;

if (!empty($_POST['locale'])) {
Expand Down Expand Up @@ -1397,21 +1375,13 @@ function install_already_done_error() {
* the profile cannot be loaded.
*/
function install_load_profile(&$install_state) {
foreach (drupal_get_profiles() as $profile) {
$profile_file = DRUPAL_ROOT . "/profiles/$profile/$profile.profile";
if (file_exists($profile_file)) {
include_once $profile_file;

if ($install_state['parameters']['profile'] == $profile) {
$install_state['profile_info'] = install_profile_info($profile, $install_state['parameters']['locale']);
}
else {
$install_state['base_profiles_info'][] = install_profile_info($profile, $install_state['parameters']['locale']);
}
}
else {
throw new Exception(st('Sorry, the profile you have chosen cannot be loaded.'));
}
$profile_file = DRUPAL_ROOT . '/profiles/' . $install_state['parameters']['profile'] . '/' . $install_state['parameters']['profile'] . '.profile';
if (file_exists($profile_file)) {
include_once $profile_file;
$install_state['profile_info'] = install_profile_info($install_state['parameters']['profile'], $install_state['parameters']['locale']);
}
else {
throw new Exception(st('Sorry, the profile you have chosen cannot be loaded.'));
}
}

Expand Down Expand Up @@ -1446,9 +1416,7 @@ function install_profile_modules(&$install_state) {
// Although the profile module is marked as required, it needs to go after
// every dependency, including non-required ones. So clear its required
// flag for now to allow it to install late.
foreach (drupal_get_profiles() as $profile) {
$files[$profile]->info['required'] = FALSE;
}
$files[$install_state['parameters']['profile']]->info['required'] = FALSE;
// Add modules that other modules depend on.
foreach ($modules as $module) {
if ($files[$module]->requires) {
Expand Down Expand Up @@ -1609,10 +1577,6 @@ function install_finished(&$install_state) {

// Remember the profile which was used.
variable_set('install_profile', drupal_get_profile());
// When sub-profiles are used, remember the dependency tree.
if ($profiles = install_get_base_profiles()) {
variable_set('install_profiles', $profiles);
}

// Installation profiles are always loaded last
db_update('system')
Expand Down
87 changes: 20 additions & 67 deletions public/includes/install.inc
Original file line number Diff line number Diff line change
Expand Up @@ -676,28 +676,15 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') {
* The list of modules to install.
*/
function drupal_verify_profile($install_state) {
$selected_profile = $install_state['parameters']['profile'];
$profile = $install_state['parameters']['profile'];
$locale = $install_state['parameters']['locale'];

include_once DRUPAL_ROOT . '/includes/file.inc';
include_once DRUPAL_ROOT . '/includes/common.inc';

$profiles = drupal_get_profiles();
$profile_file = DRUPAL_ROOT . "/profiles/$profile/$profile.profile";

if (!empty($profiles)) {
$profile_dependencies = array();

foreach ($profiles as $profile) {
$profile_file = DRUPAL_ROOT . "/profiles/$profile/$profile.profile";

if (!file_exists($profile_file)) {
throw new Exception(install_no_profile_error());
}
$info = install_profile_info($profile);
$profile_dependencies = array_unique(array_merge($profile_dependencies, $info['dependencies']));
}
}
else {
if (!isset($profile) || !file_exists($profile_file)) {
throw new Exception(install_no_profile_error());
}
$info = $install_state['profile_info'];
Expand All @@ -710,10 +697,10 @@ function drupal_verify_profile($install_state) {

// The installation profile is also a module, which needs to be installed
// after all the other dependencies have been installed.
$present_modules = array_merge($present_modules, $profiles);
$present_modules[] = drupal_get_profile();

// Verify that all of the profile's required modules are present.
$missing_modules = array_diff($profile_dependencies, $present_modules);
$missing_modules = array_diff($info['dependencies'], $present_modules);

$requirements = array();

Expand Down Expand Up @@ -791,7 +778,7 @@ function drupal_uninstall_modules($module_list = array(), $uninstall_dependents
// Create an associative array with weights as values.
$module_list = array_flip(array_values($module_list));

$profiles = drupal_get_profiles();
$profile = drupal_get_profile();
foreach (array_keys($module_list) as $module) {
if (!isset($module_data[$module]) || drupal_get_installed_schema_version($module) == SCHEMA_UNINSTALLED) {
// This module doesn't exist or is already uninstalled. Skip it.
Expand All @@ -805,7 +792,7 @@ function drupal_uninstall_modules($module_list = array(), $uninstall_dependents
// them automatically because uninstalling a module is a destructive
// operation.
foreach (array_keys($module_data[$module]->required_by) as $dependent) {
if (!isset($module_list[$dependent]) && drupal_get_installed_schema_version($dependent) != SCHEMA_UNINSTALLED && !in_array($dependent, $profiles)) {
if (!isset($module_list[$dependent]) && drupal_get_installed_schema_version($dependent) != SCHEMA_UNINSTALLED && $dependent != $profile) {
return FALSE;
}
}
Expand Down Expand Up @@ -1144,12 +1131,7 @@ function st($string, array $args = array(), array $options = array()) {
// with its name ending in {$install_state['parameters']['locale']}.po
// This might or might not be the entire filename. It is also possible
// that multiple files end with the same extension, even if unlikely.
$po_files = array();

foreach (drupal_get_profiles() as $profile) {
$locales = file_scan_directory('./profiles/' . $profile . '/translations', '/'. $install_state['parameters']['locale'] .'\.po$/', array('recurse' => FALSE));
$po_files = array_merge($po_files, $locales);
}
$po_files = file_scan_directory('./profiles/' . $install_state['parameters']['profile'] . '/translations', '/'. $install_state['parameters']['locale'] .'\.po$/', array('recurse' => FALSE));
if (count($po_files)) {
require_once DRUPAL_ROOT . '/includes/locale.inc';
foreach ($po_files as $po_file) {
Expand Down Expand Up @@ -1189,36 +1171,24 @@ function st($string, array $args = array(), array $options = array()) {
*/
function drupal_check_profile($profile) {
include_once DRUPAL_ROOT . '/includes/file.inc';
$requirements = array();

if (isset($profile)) {
$profile_dependencies = array();

// Loop through all active install profiles to collect dependencies.
foreach (drupal_get_profiles() as $profile) {
$profile_file = DRUPAL_ROOT . "/profiles/$profile/$profile.profile";
$profile_file = DRUPAL_ROOT . "/profiles/$profile/$profile.profile";

if (!file_exists($profile_file)) {
throw new Exception(install_no_profile_error());
}
if (!isset($profile) || !file_exists($profile_file)) {
throw new Exception(install_no_profile_error());
}

$info = install_profile_info($profile);
$profile_dependencies = array_unique(array_merge($profile_dependencies, $info['dependencies']));
}
$info = install_profile_info($profile);

// Collect requirement testing results.
foreach ($profile_dependencies as $module) {
module_load_install($module);
$function = $module . '_requirements';
if (function_exists($function)) {
$requirements = array_merge($requirements, $function('install'));
}
// Collect requirement testing results.
$requirements = array();
foreach ($info['dependencies'] as $module) {
module_load_install($module);
$function = $module . '_requirements';
if (function_exists($function)) {
$requirements = array_merge($requirements, $function('install'));
}
}
else {
throw new Exception(install_no_profile_error());
}

return $requirements;
}

Expand Down Expand Up @@ -1344,23 +1314,6 @@ function install_profile_info($profile, $locale = 'en') {
return $cache[$profile];
}

/**
* Get a list of base install profiles from a specified install profile.
*/
function install_get_base_profiles() {
$profile = drupal_get_profile();
$info = drupal_parse_info_file("profiles/$profile/$profile.info");

$profiles = array($profile);
while (!empty($info) && isset($info['base'])) {
$profiles[] = $info['base'];
$profile = $info['base'];
$info = drupal_parse_info_file("profiles/$profile/$profile.info");
}
$profiles = array_reverse($profiles);
return $profiles;
}

/**
* Ensures the environment for a Drupal database on a predefined connection.
*
Expand Down
6 changes: 3 additions & 3 deletions public/includes/module.inc
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ function module_disable($module_list, $disable_dependents = TRUE) {
// Create an associative array with weights as values.
$module_list = array_flip(array_values($module_list));

$profiles = drupal_get_profiles();
$profile = drupal_get_profile();
// The array is iterated over manually (instead of using a foreach) because
// modules may be added to the list within the loop and we need to process
// them.
Expand All @@ -559,7 +559,7 @@ function module_disable($module_list, $disable_dependents = TRUE) {
// Add dependent modules to the list, with a placeholder weight.
// The new modules will be processed as the while loop continues.
foreach ($module_data[$module]->required_by as $dependent => $dependent_data) {
if (!isset($module_list[$dependent]) && !in_array($dependent, $profiles)) {
if (!isset($module_list[$dependent]) && $dependent != $profile) {
$module_list[$dependent] = 0;
}
}
Expand Down Expand Up @@ -987,7 +987,7 @@ function drupal_required_modules() {
$required = array();

// An installation profile is required and one must always be loaded.
$required = array_merge($required, drupal_get_profiles());
$required[] = drupal_get_profile();

foreach ($files as $name => $file) {
$info = drupal_parse_info_file($file->uri);
Expand Down
4 changes: 4 additions & 0 deletions public/misc/brumann/polyfill-unserialize/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/vendor/
/phpunit.xml
/.composer.lock

Loading

0 comments on commit 98f60f9

Please sign in to comment.