Update core 8.3.0
This commit is contained in:
parent
da7a7918f8
commit
cd7a898e66
6144 changed files with 132297 additions and 87747 deletions
web/core/modules/update
|
@ -20,46 +20,73 @@ use Drupal\Core\Site\Settings;
|
|||
|
||||
/**
|
||||
* Project is missing security update(s).
|
||||
*
|
||||
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
|
||||
* Use \Drupal\update\UpdateManagerInterface::NOT_SECURE instead.
|
||||
*/
|
||||
const UPDATE_NOT_SECURE = 1;
|
||||
|
||||
/**
|
||||
* Current release has been unpublished and is no longer available.
|
||||
*
|
||||
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
|
||||
* Use \Drupal\update\UpdateManagerInterface::REVOKED instead.
|
||||
*/
|
||||
const UPDATE_REVOKED = 2;
|
||||
|
||||
/**
|
||||
* Current release is no longer supported by the project maintainer.
|
||||
*
|
||||
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
|
||||
* Use \Drupal\update\UpdateManagerInterface::NOT_SUPPORTED instead.
|
||||
*/
|
||||
const UPDATE_NOT_SUPPORTED = 3;
|
||||
|
||||
/**
|
||||
* Project has a new release available, but it is not a security release.
|
||||
*
|
||||
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
|
||||
* Use \Drupal\update\UpdateManagerInterface::NOT_CURRENT instead.
|
||||
*/
|
||||
const UPDATE_NOT_CURRENT = 4;
|
||||
|
||||
/**
|
||||
* Project is up to date.
|
||||
*
|
||||
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
|
||||
* Use \Drupal\update\UpdateManagerInterface::CURRENT instead.
|
||||
*/
|
||||
const UPDATE_CURRENT = 5;
|
||||
|
||||
/**
|
||||
* Project's status cannot be checked.
|
||||
*
|
||||
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
|
||||
* Use \Drupal\update\UpdateFetcherInterface::NOT_CHECKED instead.
|
||||
*/
|
||||
const UPDATE_NOT_CHECKED = -1;
|
||||
|
||||
/**
|
||||
* No available update data was found for project.
|
||||
*
|
||||
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
|
||||
* Use \Drupal\update\UpdateFetcherInterface::UNKNOWN instead.
|
||||
*/
|
||||
const UPDATE_UNKNOWN = -2;
|
||||
|
||||
/**
|
||||
* There was a failure fetching available update data for this project.
|
||||
*
|
||||
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
|
||||
* Use \Drupal\update\UpdateFetcherInterface::NOT_FETCHED instead.
|
||||
*/
|
||||
const UPDATE_NOT_FETCHED = -3;
|
||||
|
||||
/**
|
||||
* We need to (re)fetch available update data for this project.
|
||||
*
|
||||
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
|
||||
* Use \Drupal\update\UpdateFetcherInterface::FETCH_PENDING instead.
|
||||
*/
|
||||
const UPDATE_FETCH_PENDING = -4;
|
||||
|
||||
|
@ -71,7 +98,7 @@ function update_help($route_name, RouteMatchInterface $route_match) {
|
|||
case 'help.page.update':
|
||||
$output = '';
|
||||
$output .= '<h3>' . t('About') . '</h3>';
|
||||
$output .= '<p>' . t('The Update Manager module periodically checks for new versions of your site\'s software (including contributed modules and themes), and alerts administrators to available updates. The Update Manager system is also used by some other modules to manage updates and downloads; for example, the Interface Translation module uses the Update Manager to download translations from the localization server. Note that whenever the Update Manager system is used, anonymous usage statistics are sent to Drupal.org. If desired, you may disable the Update Manager module from the <a href=":modules">Extend page</a>; if you do so, functionality that depends on the Update Manager system will not work. For more information, see the <a href=":update">online documentation for the Update Manager module</a>.', array(':update' => 'https://www.drupal.org/documentation/modules/update', ':modules' => \Drupal::url('system.modules_list'))) . '</p>';
|
||||
$output .= '<p>' . t('The Update Manager module periodically checks for new versions of your site\'s software (including contributed modules and themes), and alerts administrators to available updates. The Update Manager system is also used by some other modules to manage updates and downloads; for example, the Interface Translation module uses the Update Manager to download translations from the localization server. Note that whenever the Update Manager system is used, anonymous usage statistics are sent to Drupal.org. If desired, you may disable the Update Manager module from the <a href=":modules">Extend page</a>; if you do so, functionality that depends on the Update Manager system will not work. For more information, see the <a href=":update">online documentation for the Update Manager module</a>.', [':update' => 'https://www.drupal.org/documentation/modules/update', ':modules' => \Drupal::url('system.modules_list')]) . '</p>';
|
||||
// Only explain the Update manager if it has not been disabled.
|
||||
if (_update_manager_access()) {
|
||||
$output .= '<p>' . t('The Update Manager also allows administrators to update and install modules and themes through the administration interface.') . '</p>';
|
||||
|
@ -79,13 +106,13 @@ function update_help($route_name, RouteMatchInterface $route_match) {
|
|||
$output .= '<h3>' . t('Uses') . '</h3>';
|
||||
$output .= '<dl>';
|
||||
$output .= '<dt>' . t('Checking for available updates') . '</dt>';
|
||||
$output .= '<dd>' . t('The <a href=":update-report">Available updates report</a> displays core, contributed modules, and themes for which there are new releases available for download. On the report page, you can also check manually for updates. You can configure the frequency of update checks, which are performed during cron runs, and whether notifications are sent on the <a href=":update-settings">Update Manager settings page</a>.', array(':update-report' => \Drupal::url('update.status'), ':update-settings' => \Drupal::url('update.settings'))) . '</dd>';
|
||||
$output .= '<dd>' . t('The <a href=":update-report">Available updates report</a> displays core, contributed modules, and themes for which there are new releases available for download. On the report page, you can also check manually for updates. You can configure the frequency of update checks, which are performed during cron runs, and whether notifications are sent on the <a href=":update-settings">Update Manager settings page</a>.', [':update-report' => \Drupal::url('update.status'), ':update-settings' => \Drupal::url('update.settings')]) . '</dd>';
|
||||
// Only explain the Update manager if it has not been disabled.
|
||||
if (_update_manager_access()) {
|
||||
$output .= '<dt>' . t('Performing updates through the Update page') . '</dt>';
|
||||
$output .= '<dd>' . t('The Update Manager module allows administrators to perform updates directly from the <a href=":update-page">Update page</a>. It lists all available updates, and you can confirm whether you want to download them. If you don\'t have sufficient access rights to your web server, you could be prompted for your FTP/SSH password. Afterwards the files are transferred into your site installation, overwriting your old files. Direct links to the Update page are also displayed on the <a href=":modules_page">Extend page</a> and the <a href=":themes_page">Appearance page</a>.', array(':modules_page' => \Drupal::url('system.modules_list'), ':themes_page' => \Drupal::url('system.themes_page'), ':update-page' => \Drupal::url('update.report_update'))) . '</dd>';
|
||||
$output .= '<dd>' . t('The Update Manager module allows administrators to perform updates directly from the <a href=":update-page">Update page</a>. It lists all available updates, and you can confirm whether you want to download them. If you don\'t have sufficient access rights to your web server, you could be prompted for your FTP/SSH password. Afterwards the files are transferred into your site installation, overwriting your old files. Direct links to the Update page are also displayed on the <a href=":modules_page">Extend page</a> and the <a href=":themes_page">Appearance page</a>.', [':modules_page' => \Drupal::url('system.modules_list'), ':themes_page' => \Drupal::url('system.themes_page'), ':update-page' => \Drupal::url('update.report_update')]) . '</dd>';
|
||||
$output .= '<dt>' . t('Installing new modules and themes through the Install page') . '</dt>';
|
||||
$output .= '<dd>' . t('You can also install new modules and themes in the same fashion, through the <a href=":install">Install page</a>, or by clicking the <em>Install new module/theme</em> links at the top of the <a href=":modules_page">Extend page</a> and the <a href=":themes_page">Appearance page</a>. In this case, you are prompted to provide either the URL to the download, or to upload a packaged release file from your local computer.', array(':modules_page' => \Drupal::url('system.modules_list'), ':themes_page' => \Drupal::url('system.themes_page'), ':install' => \Drupal::url('update.report_install'))) . '</dd>';
|
||||
$output .= '<dd>' . t('You can also install new modules and themes in the same fashion, through the <a href=":install">Install page</a>, or by clicking the <em>Install new module/theme</em> links at the top of the <a href=":modules_page">Extend page</a> and the <a href=":themes_page">Appearance page</a>. In this case, you are prompted to provide either the URL to the download, or to upload a packaged release file from your local computer.', [':modules_page' => \Drupal::url('system.modules_list'), ':themes_page' => \Drupal::url('system.themes_page'), ':install' => \Drupal::url('update.report_install')]) . '</dd>';
|
||||
}
|
||||
$output .= '</dl>';
|
||||
return $output;
|
||||
|
@ -95,10 +122,10 @@ function update_help($route_name, RouteMatchInterface $route_match) {
|
|||
|
||||
case 'system.modules_list':
|
||||
if (_update_manager_access()) {
|
||||
$output = '<p>' . t('Regularly review and install <a href=":updates">available updates</a> to maintain a secure and current site. Always run the <a href=":update-php">update script</a> each time a module is updated.', array(':update-php' => \Drupal::url('system.db_update'), ':updates' => \Drupal::url('update.status'))) . '</p>';
|
||||
$output = '<p>' . t('Regularly review and install <a href=":updates">available updates</a> to maintain a secure and current site. Always run the <a href=":update-php">update script</a> each time a module is updated.', [':update-php' => \Drupal::url('system.db_update'), ':updates' => \Drupal::url('update.status')]) . '</p>';
|
||||
}
|
||||
else {
|
||||
$output = '<p>' . t('Regularly review <a href=":updates">available updates</a> to maintain a secure and current site. Always run the <a href=":update-php">update script</a> each time a module is updated.', array(':update-php' => \Drupal::url('system.db_update'), ':updates' => \Drupal::url('update.status'))) . '</p>';
|
||||
$output = '<p>' . t('Regularly review <a href=":updates">available updates</a> to maintain a secure and current site. Always run the <a href=":update-php">update script</a> each time a module is updated.', [':update-php' => \Drupal::url('system.db_update'), ':updates' => \Drupal::url('update.status')]) . '</p>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
@ -137,7 +164,7 @@ function update_page_top() {
|
|||
}
|
||||
module_load_install('update');
|
||||
$status = update_requirements('runtime');
|
||||
foreach (array('core', 'contrib') as $report_type) {
|
||||
foreach (['core', 'contrib'] as $report_type) {
|
||||
$type = 'update_' . $report_type;
|
||||
// hook_requirements() supports render arrays therefore we need to render
|
||||
// them before using drupal_set_message().
|
||||
|
@ -185,25 +212,25 @@ function _update_manager_access() {
|
|||
* Implements hook_theme().
|
||||
*/
|
||||
function update_theme() {
|
||||
return array(
|
||||
'update_last_check' => array(
|
||||
'variables' => array('last' => 0),
|
||||
),
|
||||
'update_report' => array(
|
||||
'variables' => array('data' => NULL),
|
||||
return [
|
||||
'update_last_check' => [
|
||||
'variables' => ['last' => 0],
|
||||
],
|
||||
'update_report' => [
|
||||
'variables' => ['data' => NULL],
|
||||
'file' => 'update.report.inc',
|
||||
),
|
||||
'update_project_status' => array(
|
||||
'variables' => array('project' => array()),
|
||||
],
|
||||
'update_project_status' => [
|
||||
'variables' => ['project' => []],
|
||||
'file' => 'update.report.inc',
|
||||
),
|
||||
],
|
||||
// We are using template instead of '#type' => 'table' here to keep markup
|
||||
// out of preprocess and allow for easier changes to markup.
|
||||
'update_version' => array(
|
||||
'variables' => array('version' => NULL, 'title' => NULL, 'attributes' => array()),
|
||||
'update_version' => [
|
||||
'variables' => ['version' => NULL, 'title' => NULL, 'attributes' => []],
|
||||
'file' => 'update.report.inc',
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -285,10 +312,10 @@ function update_storage_clear_submit($form, FormStateInterface $form_state) {
|
|||
*/
|
||||
function _update_no_data() {
|
||||
$destination = \Drupal::destination()->getAsArray();
|
||||
return t('No update information available. <a href=":run_cron">Run cron</a> or <a href=":check_manually">check manually</a>.', array(
|
||||
return t('No update information available. <a href=":run_cron">Run cron</a> or <a href=":check_manually">check manually</a>.', [
|
||||
':run_cron' => \Drupal::url('system.run_cron', [], ['query' => $destination]),
|
||||
':check_manually' => \Drupal::url('update.manual_status', [], ['query' => $destination]),
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -444,20 +471,20 @@ function update_fetch_data_finished($success, $results) {
|
|||
function update_mail($key, &$message, $params) {
|
||||
$langcode = $message['langcode'];
|
||||
$language = \Drupal::languageManager()->getLanguage($langcode);
|
||||
$message['subject'] .= t('New release(s) available for @site_name', array('@site_name' => \Drupal::config('system.site')->get('name')), array('langcode' => $langcode));
|
||||
$message['subject'] .= t('New release(s) available for @site_name', ['@site_name' => \Drupal::config('system.site')->get('name')], ['langcode' => $langcode]);
|
||||
foreach ($params as $msg_type => $msg_reason) {
|
||||
$message['body'][] = _update_message_text($msg_type, $msg_reason, $langcode);
|
||||
}
|
||||
$message['body'][] = t('See the available updates page for more information:', array(), array('langcode' => $langcode)) . "\n" . \Drupal::url('update.status', [], ['absolute' => TRUE, 'language' => $language]);
|
||||
$message['body'][] = t('See the available updates page for more information:', [], ['langcode' => $langcode]) . "\n" . \Drupal::url('update.status', [], ['absolute' => TRUE, 'language' => $language]);
|
||||
if (_update_manager_access()) {
|
||||
$message['body'][] = t('You can automatically install your missing updates using the Update manager:', array(), array('langcode' => $langcode)) . "\n" . \Drupal::url('update.report_update', [], ['absolute' => TRUE, 'language' => $language]);
|
||||
$message['body'][] = t('You can automatically install your missing updates using the Update manager:', [], ['langcode' => $langcode]) . "\n" . \Drupal::url('update.report_update', [], ['absolute' => TRUE, 'language' => $language]);
|
||||
}
|
||||
$settings_url = \Drupal::url('update.settings', [], ['absolute' => TRUE]);
|
||||
if (\Drupal::config('update.settings')->get('notification.threshold') == 'all') {
|
||||
$message['body'][] = t('Your site is currently configured to send these emails when any updates are available. To get notified only for security updates, @url.', array('@url' => $settings_url));
|
||||
$message['body'][] = t('Your site is currently configured to send these emails when any updates are available. To get notified only for security updates, @url.', ['@url' => $settings_url]);
|
||||
}
|
||||
else {
|
||||
$message['body'][] = t('Your site is currently configured to send these emails only when security updates are available. To get notified for any available updates, @url.', array('@url' => $settings_url));
|
||||
$message['body'][] = t('Your site is currently configured to send these emails only when security updates are available. To get notified for any available updates, @url.', ['@url' => $settings_url]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -484,37 +511,37 @@ function _update_message_text($msg_type, $msg_reason, $langcode = NULL) {
|
|||
switch ($msg_reason) {
|
||||
case UPDATE_NOT_SECURE:
|
||||
if ($msg_type == 'core') {
|
||||
$text = t('There is a security update available for your version of Drupal. To ensure the security of your server, you should update immediately!', array(), array('langcode' => $langcode));
|
||||
$text = t('There is a security update available for your version of Drupal. To ensure the security of your server, you should update immediately!', [], ['langcode' => $langcode]);
|
||||
}
|
||||
else {
|
||||
$text = t('There are security updates available for one or more of your modules or themes. To ensure the security of your server, you should update immediately!', array(), array('langcode' => $langcode));
|
||||
$text = t('There are security updates available for one or more of your modules or themes. To ensure the security of your server, you should update immediately!', [], ['langcode' => $langcode]);
|
||||
}
|
||||
break;
|
||||
|
||||
case UPDATE_REVOKED:
|
||||
if ($msg_type == 'core') {
|
||||
$text = t('Your version of Drupal has been revoked and is no longer available for download. Upgrading is strongly recommended!', array(), array('langcode' => $langcode));
|
||||
$text = t('Your version of Drupal has been revoked and is no longer available for download. Upgrading is strongly recommended!', [], ['langcode' => $langcode]);
|
||||
}
|
||||
else {
|
||||
$text = t('The installed version of at least one of your modules or themes has been revoked and is no longer available for download. Upgrading or disabling is strongly recommended!', array(), array('langcode' => $langcode));
|
||||
$text = t('The installed version of at least one of your modules or themes has been revoked and is no longer available for download. Upgrading or disabling is strongly recommended!', [], ['langcode' => $langcode]);
|
||||
}
|
||||
break;
|
||||
|
||||
case UPDATE_NOT_SUPPORTED:
|
||||
if ($msg_type == 'core') {
|
||||
$text = t('Your version of Drupal is no longer supported. Upgrading is strongly recommended!', array(), array('langcode' => $langcode));
|
||||
$text = t('Your version of Drupal is no longer supported. Upgrading is strongly recommended!', [], ['langcode' => $langcode]);
|
||||
}
|
||||
else {
|
||||
$text = t('The installed version of at least one of your modules or themes is no longer supported. Upgrading or disabling is strongly recommended. See the project homepage for more details.', array(), array('langcode' => $langcode));
|
||||
$text = t('The installed version of at least one of your modules or themes is no longer supported. Upgrading or disabling is strongly recommended. See the project homepage for more details.', [], ['langcode' => $langcode]);
|
||||
}
|
||||
break;
|
||||
|
||||
case UPDATE_NOT_CURRENT:
|
||||
if ($msg_type == 'core') {
|
||||
$text = t('There are updates available for your version of Drupal. To ensure the proper functioning of your site, you should update as soon as possible.', array(), array('langcode' => $langcode));
|
||||
$text = t('There are updates available for your version of Drupal. To ensure the proper functioning of your site, you should update as soon as possible.', [], ['langcode' => $langcode]);
|
||||
}
|
||||
else {
|
||||
$text = t('There are updates available for one or more of your modules or themes. To ensure the proper functioning of your site, you should update as soon as possible.', array(), array('langcode' => $langcode));
|
||||
$text = t('There are updates available for one or more of your modules or themes. To ensure the proper functioning of your site, you should update as soon as possible.', [], ['langcode' => $langcode]);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -523,10 +550,10 @@ function _update_message_text($msg_type, $msg_reason, $langcode = NULL) {
|
|||
case UPDATE_NOT_FETCHED:
|
||||
case UPDATE_FETCH_PENDING:
|
||||
if ($msg_type == 'core') {
|
||||
$text = t('There was a problem checking <a href=":update-report">available updates</a> for Drupal.', array(':update-report' => \Drupal::url('update.status')), array('langcode' => $langcode));
|
||||
$text = t('There was a problem checking <a href=":update-report">available updates</a> for Drupal.', [':update-report' => \Drupal::url('update.status')], ['langcode' => $langcode]);
|
||||
}
|
||||
else {
|
||||
$text = t('There was a problem checking <a href=":update-report">available updates</a> for your modules or themes.', array(':update-report' => \Drupal::url('update.status')), array('langcode' => $langcode));
|
||||
$text = t('There was a problem checking <a href=":update-report">available updates</a> for your modules or themes.', [':update-report' => \Drupal::url('update.status')], ['langcode' => $langcode]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -566,7 +593,7 @@ function _update_project_status_sort($a, $b) {
|
|||
*/
|
||||
function template_preprocess_update_last_check(&$variables) {
|
||||
$variables['time'] = \Drupal::service('date.formatter')->formatTimeDiffSince($variables['last']);
|
||||
$variables['link'] = \Drupal::l(t('Check manually'), new Url('update.manual_status', array(), array('query' => \Drupal::destination()->getAsArray())));
|
||||
$variables['link'] = \Drupal::l(t('Check manually'), new Url('update.manual_status', [], ['query' => \Drupal::destination()->getAsArray()]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -583,7 +610,7 @@ function template_preprocess_update_last_check(&$variables) {
|
|||
* @see _system_rebuild_module_data()
|
||||
*/
|
||||
function update_verify_update_archive($project, $archive_file, $directory) {
|
||||
$errors = array();
|
||||
$errors = [];
|
||||
|
||||
// Make sure this isn't a tarball of Drupal core.
|
||||
if (
|
||||
|
@ -593,9 +620,9 @@ function update_verify_update_archive($project, $archive_file, $directory) {
|
|||
&& file_exists("$directory/$project/core/modules/node/node.module")
|
||||
&& file_exists("$directory/$project/core/modules/system/system.module")
|
||||
) {
|
||||
return array(
|
||||
'no-core' => t('Automatic updating of Drupal core is not supported. See the <a href=":upgrade-guide">upgrade guide</a> for information on how to update Drupal core manually.', array(':upgrade-guide' => 'https://www.drupal.org/upgrade')),
|
||||
);
|
||||
return [
|
||||
'no-core' => t('Automatic updating of Drupal core is not supported. See the <a href=":upgrade-guide">upgrade guide</a> for information on how to update Drupal core manually.', [':upgrade-guide' => 'https://www.drupal.org/upgrade']),
|
||||
];
|
||||
}
|
||||
|
||||
// Parse all the .info.yml files and make sure at least one is compatible with
|
||||
|
@ -604,8 +631,8 @@ function update_verify_update_archive($project, $archive_file, $directory) {
|
|||
// with some out-of-date modules that are not necessary for its overall
|
||||
// functionality).
|
||||
$compatible_project = FALSE;
|
||||
$incompatible = array();
|
||||
$files = file_scan_directory("$directory/$project", '/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.info.yml$/', array('key' => 'name', 'min_depth' => 0));
|
||||
$incompatible = [];
|
||||
$files = file_scan_directory("$directory/$project", '/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.info.yml$/', ['key' => 'name', 'min_depth' => 0]);
|
||||
foreach ($files as $file) {
|
||||
// Get the .info.yml file for the module or theme this file belongs to.
|
||||
$info = \Drupal::service('info_parser')->parse($file->uri);
|
||||
|
@ -621,14 +648,14 @@ function update_verify_update_archive($project, $archive_file, $directory) {
|
|||
}
|
||||
|
||||
if (empty($files)) {
|
||||
$errors[] = t('%archive_file does not contain any .info.yml files.', array('%archive_file' => drupal_basename($archive_file)));
|
||||
$errors[] = t('%archive_file does not contain any .info.yml files.', ['%archive_file' => drupal_basename($archive_file)]);
|
||||
}
|
||||
elseif (!$compatible_project) {
|
||||
$errors[] = \Drupal::translation()->formatPlural(
|
||||
count($incompatible),
|
||||
'%archive_file contains a version of %names that is not compatible with Drupal @version.',
|
||||
'%archive_file contains versions of modules or themes that are not compatible with Drupal @version: %names',
|
||||
array('@version' => \Drupal::CORE_COMPATIBILITY, '%archive_file' => drupal_basename($archive_file), '%names' => implode(', ', $incompatible))
|
||||
['@version' => \Drupal::CORE_COMPATIBILITY, '%archive_file' => drupal_basename($archive_file), '%names' => implode(', ', $incompatible)]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -707,14 +734,14 @@ function _update_manager_cache_directory($create = TRUE) {
|
|||
function update_clear_update_disk_cache() {
|
||||
// List of update module cache directories. Do not create the directories if
|
||||
// they do not exist.
|
||||
$directories = array(
|
||||
$directories = [
|
||||
_update_manager_cache_directory(FALSE),
|
||||
_update_manager_extract_directory(FALSE),
|
||||
);
|
||||
];
|
||||
|
||||
// Search for files and directories in base folder only without recursion.
|
||||
foreach ($directories as $directory) {
|
||||
file_scan_directory($directory, '/.*/', array('callback' => 'update_delete_file_if_stale', 'recurse' => FALSE));
|
||||
file_scan_directory($directory, '/.*/', ['callback' => 'update_delete_file_if_stale', 'recurse' => FALSE]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue