Commit 448b5146 authored by Sergey Shadrin's avatar Sergey Shadrin

[#124455] Removed `update` module

-Added patch for core
-Added patch for admin_toolbar
-Update module excluded from git
parent eb3f644a
......@@ -5,7 +5,8 @@ sites/*/files/*
sites/*/private
sites/*/settings.php
# Exclude update module
docroot/core/modules/update
!core/modules/update/update.info.yml
core/modules/update
# Exclude IDE specific directories.
.idea
......
......@@ -88,9 +88,11 @@
},
"patches": {
"drupal/core": {
"Remove update module": "./patches/core/remove-update-module.patch",
"Replace icons": "./patches/core/core-icons.patch"
},
"drupal/admin_toolbar": {
"Remove update module": "./patches/admin_toolbar/remove-update-module.patch",
"Replace icons": "./patches/admin_toolbar/replace-icons.patch"
}
}
......
This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)
Patches applied to this directory:
Remove update module
Source: ./patches/core/remove-update-module.patch
Replace icons
Source: ./patches/core/core-icons.patch
......
check:
disabled_extensions: false
interval_days: 1
fetch:
url: ''
max_attempts: 2
timeout: 30
notification:
emails: { }
threshold: all
# Schema for the configuration files of the Update module.
update.settings:
type: config_object
label: 'Update settings'
mapping:
check:
type: mapping
label: 'Check settings'
mapping:
disabled_extensions:
type: boolean
label: 'Check for updates of uninstalled modules and themes'
interval_days:
type: integer
label: 'Days since last check'
fetch:
type: mapping
label: 'Fetch settings'
mapping:
url:
type: uri
label: 'URL for fetching available update data'
max_attempts:
type: integer
label: 'Maximum attempts'
timeout:
type: integer
label: 'Timeout in seconds'
notification:
type: mapping
label: 'Notification settings'
mapping:
emails:
type: sequence
label: 'Email addresses to notify when updates are available'
sequence:
type: email
label: 'Email'
threshold:
type: string
label: 'Email notification threshold'
/**
* @file
* Styles used by the Update Manager module.
*/
.project-update__title {
font-size: 110%;
font-weight: bold;
}
.project-update__status {
float: right; /* LTR */
font-size: 110%;
}
[dir="rtl"] .project-update__status {
float: left;
}
.project-update__status--not-supported {
float: left; /* LTR */
}
[dir="rtl"] .project-update__status--not-supported {
float: right;
}
.project-update__status--security-error {
color: #970f00;
font-weight: bold;
}
.project-update__status-icon {
padding-left: 0.5em; /* LTR */
}
[dir="rtl"] .project-update__status-icon {
padding-right: 0.5em;
padding-left: 0;
}
.project-update__details {
padding: 1em 1em 0.25em 1em;
}
.project-update__version {
padding: 1em 0;
}
.project-update__version-date {
white-space: nowrap;
}
.project-update__version-details {
padding-right: 0.5em; /* LTR */
}
[dir="rtl"] .project-update__version-details {
padding-left: 0.5em;
direction: ltr; /* Version numbers should always be LTR. */
}
.project-update__version-links {
padding-right: 1em; /* LTR */
list-style-type: none;
text-align: right; /* LTR */
}
[dir="rtl"] .project-update__version-links {
padding-left: 1em;
text-align: left;
}
.project-update__version--recommended-strong .project-update__version-title {
font-weight: bold;
}
id: update_settings
label: Update configuration
migration_tags:
- Drupal 6
- Drupal 7
- Configuration
source:
plugin: variable
variables:
- update_max_fetch_attempts
- update_fetch_url
- update_notification_threshold
- update_notify_emails
- update_check_frequency
source_module: update
process:
'fetch/max_attempts': update_max_fetch_attempts
'fetch/url': update_fetch_url
'notification/threshold': update_notification_threshold
'notification/emails': update_notify_emails
'check/interval_days': update_check_frequency
destination:
plugin: config
config_name: update.settings
<?php
namespace Drupal\update\Access;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Routing\Access\AccessInterface;
use Drupal\Core\Site\Settings;
/**
* Determines whether allow authorized operations is set.
*/
class UpdateManagerAccessCheck implements AccessInterface {
/**
* Settings Service.
*
* @var \Drupal\Core\Site\Settings
*/
protected $settings;
/**
* Constructs a UpdateManagerAccessCheck object.
*
* @param \Drupal\Core\Site\Settings $settings
* The read-only settings container.
*/
public function __construct(Settings $settings) {
$this->settings = $settings;
}
/**
* Checks access.
*
* @return \Drupal\Core\Access\AccessResultInterface
* The access result.
*/
public function access() {
// Uncacheable because the access result depends on a Settings key-value
// pair, and can therefore change at any time.
return AccessResult::allowedIf($this->settings->get('allow_authorize_operations', TRUE))->setCacheMaxAge(0);
}
}
<?php
namespace Drupal\update\Controller;
use Drupal\update\UpdateManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Controller\ControllerBase;
/**
* Controller routines for update routes.
*/
class UpdateController extends ControllerBase {
/**
* Update manager service.
*
* @var \Drupal\update\UpdateManagerInterface
*/
protected $updateManager;
/**
* Constructs update status data.
*
* @param \Drupal\update\UpdateManagerInterface $update_manager
* Update Manager Service.
*/
public function __construct(UpdateManagerInterface $update_manager) {
$this->updateManager = $update_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('update.manager')
);
}
/**
* Returns a page about the update status of projects.
*
* @return array
* A build array with the update status of projects.
*/
public function updateStatus() {
$build = [
'#theme' => 'update_report',
];
if ($available = update_get_available(TRUE)) {
$this->moduleHandler()->loadInclude('update', 'compare.inc');
$build['#data'] = update_calculate_project_data($available);
}
return $build;
}
/**
* Manually checks the update status without the use of cron.
*/
public function updateStatusManually() {
$this->updateManager->refreshUpdateData();
$batch = [
'operations' => [
[[$this->updateManager, 'fetchDataBatch'], []],
],
'finished' => 'update_fetch_data_finished',
'title' => t('Checking available update data'),
'progress_message' => t('Trying to check available update data ...'),
'error_message' => t('Error checking available update data.'),
];
batch_set($batch);
return batch_process('admin/reports/updates');
}
}
<?php
namespace Drupal\update\Form;
use Drupal\Core\Archiver\ArchiverManager;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\FileTransfer\Local;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Updater\Updater;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Response;
/**
* Configure update settings for this site.
*
* @internal
*/
class UpdateManagerInstall extends FormBase {
/**
* The module handler.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* The root location under which installed projects will be saved.
*
* @var string
*/
protected $root;
/**
* The site path.
*
* @var string
*/
protected $sitePath;
/**
* The archiver plugin manager service.
*
* @var \Drupal\Core\Archiver\ArchiverManager
*/
protected $archiverManager;
/**
* Constructs a new UpdateManagerInstall.
*
* @param string $root
* The root location under which installed projects will be saved.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
* @param string $site_path
* The site path.
* @param \Drupal\Core\Archiver\ArchiverManager $archiver_manager
* The archiver plugin manager service.
*/
public function __construct($root, ModuleHandlerInterface $module_handler, $site_path, ArchiverManager $archiver_manager) {
$this->root = $root;
$this->moduleHandler = $module_handler;
$this->sitePath = $site_path;
$this->archiverManager = $archiver_manager;
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'update_manager_install_form';
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('update.root'),
$container->get('module_handler'),
$container->get('site.path'),
$container->get('plugin.manager.archiver')
);
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$this->moduleHandler->loadInclude('update', 'inc', 'update.manager');
if (!_update_manager_check_backends($form, 'install')) {
return $form;
}
$form['help_text'] = [
'#prefix' => '<p>',
'#markup' => $this->t('You can find <a href=":module_url">modules</a> and <a href=":theme_url">themes</a> on <a href=":drupal_org_url">drupal.org</a>. The following file extensions are supported: %extensions.', [
':module_url' => 'https://www.drupal.org/project/modules',
':theme_url' => 'https://www.drupal.org/project/themes',
':drupal_org_url' => 'https://www.drupal.org',
'%extensions' => $this->archiverManager->getExtensions(),
]),
'#suffix' => '</p>',
];
$form['project_url'] = [
'#type' => 'url',
'#title' => $this->t('Install from a URL'),
'#description' => $this->t('For example: %url', ['%url' => 'https://ftp.drupal.org/files/projects/name.tar.gz']),
];
$form['information'] = [
'#prefix' => '<strong>',
'#markup' => $this->t('Or'),
'#suffix' => '</strong>',
];
$form['project_upload'] = [
'#type' => 'file',
'#title' => $this->t('Upload a module or theme archive to install'),
'#description' => $this->t('For example: %filename from your local computer', ['%filename' => 'name.tar.gz']),
];
$form['actions'] = ['#type' => 'actions'];
$form['actions']['submit'] = [
'#type' => 'submit',
'#button_type' => 'primary',
'#value' => $this->t('Install'),
];
return $form;
}
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
$all_files = $this->getRequest()->files->get('files', []);
if (!($form_state->getValue('project_url') xor !empty($all_files['project_upload']))) {
$form_state->setErrorByName('project_url', $this->t('You must either provide a URL or upload an archive file to install.'));
}
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$local_cache = NULL;
$all_files = $this->getRequest()->files->get('files', []);
if ($form_state->getValue('project_url')) {
$local_cache = update_manager_file_get($form_state->getValue('project_url'));
if (!$local_cache) {
$this->messenger()->addError($this->t('Unable to retrieve Drupal project from %url.', ['%url' => $form_state->getValue('project_url')]));
return;
}
}
elseif (!empty($all_files['project_upload'])) {
$validators = ['file_validate_extensions' => [$this->archiverManager->getExtensions()]];
if (!($finfo = file_save_upload('project_upload', $validators, NULL, 0, FileSystemInterface::EXISTS_REPLACE))) {
// Failed to upload the file. file_save_upload() calls
// \Drupal\Core\Messenger\MessengerInterface::addError() on failure.
return;
}
$local_cache = $finfo->getFileUri();
}
$directory = _update_manager_extract_directory();
try {
$archive = update_manager_archive_extract($local_cache, $directory);
}
catch (\Exception $e) {
$this->messenger()->addError($e->getMessage());
return;
}
$files = $archive->listContents();
if (!$files) {
$this->messenger()->addError($this->t('Provided archive contains no files.'));
return;
}
// Unfortunately, we can only use the directory name to determine the
// project name. Some archivers list the first file as the directory (i.e.,
// MODULE/) and others list an actual file (i.e., MODULE/README.TXT).
$project = strtok($files[0], '/\\');
$archive_errors = $this->moduleHandler->invokeAll('verify_update_archive', [$project, $local_cache, $directory]);
if (!empty($archive_errors)) {
$this->messenger()->addError(array_shift($archive_errors));
// @todo: Fix me in D8: We need a way to set multiple errors on the same
// form element and have all of them appear!
if (!empty($archive_errors)) {
foreach ($archive_errors as $error) {
$this->messenger()->addError($error);
}
}
return;
}
// Make sure the Updater registry is loaded.
drupal_get_updaters();
$project_location = $directory . '/' . $project;
try {
$updater = Updater::factory($project_location, $this->root);
}
catch (\Exception $e) {
$this->messenger()->addError($e->getMessage());
return;
}
try {
$project_title = Updater::getProjectTitle($project_location);
}
catch (\Exception $e) {
$this->messenger()->addError($e->getMessage());
return;
}
if (!$project_title) {
$this->messenger()->addError($this->t('Unable to determine %project name.', ['%project' => $project]));
}
if ($updater->isInstalled()) {
$this->messenger()->addError($this->t('%project is already installed.', ['%project' => $project_title]));
return;
}
$project_real_location = \Drupal::service('file_system')->realpath($project_location);
$arguments = [
'project' => $project,
'updater_name' => get_class($updater),
'local_url' => $project_real_location,
];
// This process is inherently difficult to test therefore use a state flag.
$test_authorize = FALSE;
if (drupal_valid_test_ua()) {
$test_authorize = \Drupal::state()->get('test_uploaders_via_prompt', FALSE);
}
// If the owner of the directory we extracted is the same as the owner of
// our configuration directory (e.g. sites/default) where we're trying to
// install the code, there's no need to prompt for FTP/SSH credentials.
// Instead, we instantiate a Drupal\Core\FileTransfer\Local and invoke
// update_authorize_run_install() directly.
if (fileowner($project_real_location) == fileowner($this->sitePath) && !$test_authorize) {
$this->moduleHandler->loadInclude('update', 'inc', 'update.authorize');
$filetransfer = new Local($this->root, \Drupal::service('file_system'));
$response = call_user_func_array('update_authorize_run_install', array_merge([$filetransfer], $arguments));
if ($response instanceof Response) {
$form_state->setResponse($response);
}
}
// Otherwise, go through the regular workflow to prompt for FTP/SSH
// credentials and invoke update_authorize_run_install() indirectly with
// whatever FileTransfer object authorize.php creates for us.
else {
// The page title must be passed here to ensure it is initially used when
// authorize.php loads for the first time with the FTP/SSH credentials
// form.
system_authorized_init('update_authorize_run_install', __DIR__ . '/../../update.authorize.inc', $arguments, $this->t('Update manager'));
$form_state->setRedirectUrl(system_authorized_get_url());
}
}
}
<?php
namespace Drupal\update\Form;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Link;
use Drupal\Core\State\StateInterface;
use Drupal\Core\Url;
use Drupal\update\UpdateFetcherInterface;
use Drupal\update\UpdateManagerInterface;
use Drupal\update\ModuleVersion;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Configure update settings for this site.
*
* @internal
*/
class UpdateManagerUpdate extends FormBase {
/**
* The module handler.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* The Drupal state storage service.
*
* @var \Drupal\Core\State\StateInterface
*/
protected $state;
/**
* Constructs a new UpdateManagerUpdate object.
*
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
* @param \Drupal\Core\State\StateInterface $state
* The state service.
*/
public function __construct(ModuleHandlerInterface $module_handler, StateInterface $state) {
$this->moduleHandler = $module_handler;
$this->state = $state;
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'update_manager_update_form';
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('module_handler'),
$container->get('state')
);
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$this->moduleHandler->loadInclude('update', 'inc', 'update.manager');
$last_markup = [
'#theme' => 'update_last_check',
'#last' => $this->state->get('update.last_check') ?: 0,
];
$form['last_check'] = [
'#markup' => \Drupal::service('renderer')->render($last_markup),
];
if (!_update_manager_check_backends($form, 'update')) {
return $form;
}
$available = update_get_available(TRUE);
if (empty($available)) {
$form['message'] = [
'#markup' => $this->t('There was a problem getting update information. Try again later.'),
];
return $form;
}
$form['#attached']['library'][] = 'update/drupal.update.admin';
// This will be a nested array. The first key is the kind of project, which
// can be either 'enabled', 'disabled', 'manual' (projects which require
// manual updates, such as core). Then, each subarray is an array of
// projects of that type, indexed by project short name, and containing an
// array of data for cells in that project's row in the appropriate table.
$projects = [];
// This stores the actual download link we're going to update from for each
// project in the form, regardless of if it's enabled or disabled.
$form['project_downloads'] = ['#tree' => TRUE];
$this->moduleHandler->loadInclude('update', 'inc', 'update.compare');
$project_data = update_calculate_project_data($available);
foreach ($project_data as $name => $project) {
// Filter out projects which are up to date already.
if ($project['status'] == UpdateManagerInterface::CURRENT) {
continue;
}
// The project name to display can vary based on the info we have.
if (!empty($project['title'])) {
if (!empty($project['link'])) {
$project_name = Link::fromTextAndUrl($project['title'], Url::fromUri($project['link']))->toString();
}
else {
$project_name = $project['title'];
}
}
elseif (!empty($project['info']['name'])) {
$project_name = $project['info']['name'];
}
else {
$project_name = $name;
}
if ($project['project_type'] == 'theme' || $project['project_type'] == 'theme-disabled') {
$project_name .= ' ' . $this->t('(Theme)');
}
if (empty($project['recommended'])) {
// If we don't know what to recommend they upgrade to, we should skip
// the project entirely.
continue;
}
$recommended_release = $project['releases'][$project['recommended']];
$recommended_version = '{{ release_version }} (<a href="{{ release_link }}" title="{{ project_title }}">{{ release_notes }}</a>)';
$recommended_version_parser = ModuleVersion::createFromVersionString($recommended_release['version']);
if ($recommended_version_parser->getMajorVersion() != $project['existing_major']) {
$recommended_version .= '<div title="{{ major_update_warning_title }}" class="update-major-version-warning">{{ major_update_warning_text }}</div>';
}
$recommended_version = [
'#type' => 'inline_template',
'#template' => $recommended_version,
'#context' => [
'release_version' => $recommended_release['version'],
'release_link' => $recommended_release['release_link'],
'project_title' => $this->t('Release notes for @project_title', ['@project_title' => $project['title']]),
'major_update_warning_title' => $this->t('Major upgrade warning'),
'major_update_warning_text' => $this->t('This update is a major version update which means that it may not be backwards compatible with your currently running version. It is recommended that you read the release notes and proceed at your own risk.'),
'release_notes' => $this->t('Release notes'),
],
];
// Create an entry for this project.
$entry = [
'title' => $project_name,
'installed_version' => $project['existing_version'],
'recommended_version' => ['data' => $recommended_version],
];
switch ($project['status']) {
case UpdateManagerInterface::NOT_SECURE:
case UpdateManagerInterface::REVOKED:
$entry['title'] .= ' ' . $this->t('(Security update)');
$entry['#weight'] = -2;
$type = 'security';
break;
case UpdateManagerInterface::NOT_SUPPORTED:
$type = 'unsupported';
$entry['title'] .= ' ' . $this->t('(Unsupported)');
$entry['#weight'] = -1;
break;
case UpdateFetcherInterface::UNKNOWN:
case UpdateFetcherInterface::NOT_FETCHED:
case UpdateFetcherInterface::NOT_CHECKED:
case UpdateManagerInterface::NOT_CURRENT:
$type = 'recommended';
break;
default:
// Jump out of the switch and onto the next project in foreach.
continue 2;
}
// Use the project title for the tableselect checkboxes.
$entry['title'] = [
'data' => [
'#title' => $entry['title'],
'#markup' => $entry['title'],
],
];
$entry['#attributes'] = ['class' => ['update-' . $type]];
// Drupal core needs to be upgraded manually.
$needs_manual = $project['project_type'] == 'core';
// If the recommended release for a contributed project is not compatible
// with the currently installed version of core, list that project in a
// separate table. To determine if the release is compatible, we inspect
// the 'core_compatible' key from the release info array. If it's not
// defined, it means we can't determine compatibility requirements (or
// we're looking at core), so we assume it is compatible.
$compatible = $recommended_release['core_compatible'] ?? TRUE;
if ($needs_manual) {
$this->removeCheckboxFromRow($entry);
$projects['manual'][$name] = $entry;
}
elseif (!$compatible) {
$this->removeCheckboxFromRow($entry);
// If the release has a core_compatibility_message, inject it.
if (!empty($recommended_release['core_compatibility_message'])) {
// @todo In https://www.drupal.org/project/drupal/issues/3121769
// refactor this into something theme-friendly so we don't have a
// classless <div> here.
$entry['data']['recommended_version']['data']['#template'] .= ' <div>{{ core_compatibility_message }}</div>';
$entry['data']['recommended_version']['data']['#context']['core_compatibility_message'] = $recommended_release['core_compatibility_message'];
}
$projects['not-compatible'][$name] = $entry;
}
else {
$form['project_downloads'][$name] = [
'#type' => 'value',
'#value' => $recommended_release['download_link'],
];
// Based on what kind of project this is, save the entry into the
// appropriate subarray.
switch ($project['project_type']) {
case 'module':
case 'theme':
$projects['enabled'][$name] = $entry;
break;
case 'module-disabled':
case 'theme-disabled':
$projects['disabled'][$name] = $entry;
break;
}
}
}
if (empty($projects)) {
$form['message'] = [
'#markup' => $this->t('All of your projects are up to date.'),
];
return $form;
}
$headers = [
'title' => [
'data' => $this->t('Name'),
'class' => ['update-project-name'],
],
'installed_version' => $this->t('Installed version'),
'recommended_version' => $this->t('Recommended version'),
];
if (!empty($projects['enabled'])) {
$form['projects'] = [
'#type' => 'tableselect',
'#header' => $headers,
'#options' => $projects['enabled'],
];
if (!empty($projects['disabled'])) {
$form['projects']['#prefix'] = '<h2>' . $this->t('Enabled') . '</h2>';
}
}
if (!empty($projects['disabled'])) {
$form['disabled_projects'] = [
'#type' => 'tableselect',
'#header' => $headers,
'#options' => $projects['disabled'],
'#weight' => 1,
'#prefix' => '<h2>' . $this->t('Disabled') . '</h2>',
];
}
// If either table has been printed yet, we need a submit button and to
// validate the checkboxes.
if (!empty($projects['enabled']) || !empty($projects['disabled'])) {
$form['actions'] = ['#type' => 'actions'];
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this->t('Download these updates'),
];
}
if (!empty($projects['manual'])) {
$prefix = '<h2>' . $this->t('Manual updates required') . '</h2>';
$prefix .= '<p>' . $this->t('Automatic updates of Drupal core are not supported at this time.') . '</p>';
$form['manual_updates'] = [
'#type' => 'table',
'#header' => $headers,
'#rows' => $projects['manual'],
'#prefix' => $prefix,
'#weight' => 120,
];
}
if (!empty($projects['not-compatible'])) {
$form['not_compatible'] = [
'#type' => 'table',
'#header' => $headers,
'#rows' => $projects['not-compatible'],
'#prefix' => '<h2>' . $this->t('Not compatible') . '</h2>',
'#weight' => 150,
];
}
return $form;
}
/**
* Prepares a row entry for use in a regular table, not a 'tableselect'.
*
* There are no checkboxes in the 'Manual updates' or 'Not compatible' tables,
* so they will be rendered by '#theme' => 'table', not 'tableselect'. Since
* the data formats are incompatible, this method converts to the format
* expected by '#theme' => 'table'. Generally, rows end up in the main tables
* that have a checkbox to allow the site admin to select which missing
* updates to install. This method is only used for the special case tables
* that have no such checkbox.
*
* @todo In https://www.drupal.org/project/drupal/issues/3121775 refactor
* self::buildForm() so that we don't need this method at all.
*
* @param array[] $row
* The render array for a table row.
*/
protected function removeCheckboxFromRow(array &$row) {
unset($row['#weight']);
$attributes = $row['#attributes'];
unset($row['#attributes']);
$row = [
'data' => $row,
] + $attributes;
}
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
if (!$form_state->isValueEmpty('projects')) {
$enabled = array_filter($form_state->getValue('projects'));
}
if (!$form_state->isValueEmpty('disabled_projects')) {
$disabled = array_filter($form_state->getValue('disabled_projects'));
}
if (empty($enabled) && empty($disabled)) {
$form_state->setErrorByName('projects', $this->t('You must select at least one project to update.'));
}
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->moduleHandler->loadInclude('update', 'inc', 'update.manager');
$projects = [];
foreach (['projects', 'disabled_projects'] as $type) {
if (!$form_state->isValueEmpty($type)) {
$projects = array_merge($projects, array_keys(array_filter($form_state->getValue($type))));
}
}
$operations = [];
foreach ($projects as $project) {
$operations[] = [
'update_manager_batch_project_get',
[
$project,
$form_state->getValue(['project_downloads', $project]),
],
];
}
$batch = [
'title' => $this->t('Downloading updates'),
'init_message' => $this->t('Preparing to download selected updates'),
'operations' => $operations,
'finished' => 'update_manager_download_batch_finished',
'file' => drupal_get_path('module', 'update') . '/update.manager.inc',
];
batch_set($batch);
}
}
<?php
namespace Drupal\update\Form;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\FileTransfer\Local;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\State\StateInterface;
use Drupal\Core\Updater\Updater;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Response;
/**
* Configure update settings for this site.
*
* @internal
*/
class UpdateReady extends FormBase {
/**
* The root location under which updated projects will be saved.
*
* @var string
*/
protected $root;
/**
* The module handler.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* The state key value store.
*
* @var \Drupal\Core\State\StateInterface
*/
protected $state;
/**
* The Site path.
*
* @var string
*/
protected $sitePath;
/**
* Constructs a new UpdateReady object.
*
* @param string $root
* The root location under which updated projects will be saved.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The object that manages enabled modules in a Drupal installation.
* @param \Drupal\Core\State\StateInterface $state
* The state key value store.
* @param string $site_path
* The site path.
*/
public function __construct($root, ModuleHandlerInterface $module_handler, StateInterface $state, $site_path) {
$this->root = $root;
$this->moduleHandler = $module_handler;
$this->state = $state;
$this->sitePath = $site_path;
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'update_manager_update_ready_form';
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('update.root'),
$container->get('module_handler'),
$container->get('state'),
$container->get('site.path')
);
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$this->moduleHandler->loadInclude('update', 'inc', 'update.manager');
if (!_update_manager_check_backends($form, 'update')) {
return $form;
}
$form['backup'] = [
'#prefix' => '<strong>',
'#markup' => $this->t('Back up your database and site before you continue. <a href=":backup_url">Learn how</a>.', [':backup_url' => 'https://www.drupal.org/node/22281']),
'#suffix' => '</strong>',
];
$form['maintenance_mode'] = [
'#title' => $this->t('Perform updates with site in maintenance mode (strongly recommended)'),
'#type' => 'checkbox',
'#default_value' => TRUE,
];
$form['actions'] = ['#type' => 'actions'];
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this->t('Continue'),
];
return $form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$session = $this->getRequest()->getSession();
// Store maintenance_mode setting so we can restore it when done.
$session->set('maintenance_mode', $this->state->get('system.maintenance_mode'));
if ($form_state->getValue('maintenance_mode') == TRUE) {
$this->state->set('system.maintenance_mode', TRUE);
}
$projects = $session->remove('update_manager_update_projects');
if ($projects) {
// Make sure the Updater registry is loaded.
drupal_get_updaters();
$updates = [];
$directory = _update_manager_extract_directory();
$project_real_location = NULL;
foreach ($projects as $project => $url) {
$project_location = $directory . '/' . $project;
$updater = Updater::factory($project_location, $this->root);
$project_real_location = \Drupal::service('file_system')->realpath($project_location);
$updates[] = [
'project' => $project,
'updater_name' => get_class($updater),
'local_url' => $project_real_location,
];
}
// If the owner of the last directory we extracted is the same as the
// owner of our configuration directory (e.g. sites/default) where we're
// trying to install the code, there's no need to prompt for FTP/SSH
// credentials. Instead, we instantiate a Drupal\Core\FileTransfer\Local
// and invoke update_authorize_run_update() directly.
if (fileowner($project_real_location) == fileowner($this->sitePath)) {
$this->moduleHandler->loadInclude('update', 'inc', 'update.authorize');
$filetransfer = new Local($this->root, \Drupal::service('file_system'));
$response = update_authorize_run_update($filetransfer, $updates);
if ($response instanceof Response) {
$form_state->setResponse($response);
}
}
// Otherwise, go through the regular workflow to prompt for FTP/SSH
// credentials and invoke update_authorize_run_update() indirectly with
// whatever FileTransfer object authorize.php creates for us.
else {
// The page title must be passed here to ensure it is initially used
// when authorize.php loads for the first time with the FTP/SSH
// credentials form.
system_authorized_init('update_authorize_run_update', __DIR__ . '/../../update.authorize.inc', [$updates], $this->t('Update manager'));
$form_state->setRedirectUrl(system_authorized_get_url());
}
}
}
}
<?php
namespace Drupal\update;
/**
* Provides a module version value object.
*
* @internal
*
* @see https://www.drupal.org/drupalorg/docs/apis/update-status-xml.
*/
final class ModuleVersion {
/**
* The '8.x-' prefix is used on contrib module version numbers.
*
* @var string
*/
const CORE_PREFIX = '8.x-';
/**
* The major version.
*
* @var string
*/
protected $majorVersion;
/**
* The version extra string.
*
* For example, if the module version is '2.0.3-alpha1', then the version
* extra string is 'alpha1'.
*
* @var string|null
*/
protected $versionExtra;
/**
* Constructs a module version object from a version string.
*
* @param string $version_string
* The version string.
*
* @return \Drupal\update\ModuleVersion
* The module version instance.
*/
public static function createFromVersionString($version_string) {
$original_version = $version_string;
if (strpos($version_string, static::CORE_PREFIX) === 0 && $version_string !== '8.x-dev') {
$version_string = preg_replace('/8\.x-/', '', $version_string, 1);
}
else {
// Ensure the version string has no unsupported core prefixes.
$dot_x_position = strpos($version_string, '.x-');
if ($dot_x_position === 1 || $dot_x_position === 2) {
$after_core_prefix = explode('.x-', $version_string)[1];
if ($after_core_prefix !== 'dev') {
throw new \UnexpectedValueException("Unexpected version core prefix in $version_string. The only core prefix expected in \Drupal\update\ModuleVersion is: 8.x-");
}
}
}
$version_parts = explode('.', $version_string);
$major_version = $version_parts[0];
$version_parts_count = count($version_parts);
$last_part_split = explode('-', $version_parts[count($version_parts) - 1]);
$version_extra = count($last_part_split) === 1 ? NULL : $last_part_split[1];
if ($version_parts_count > 3 || $version_parts_count < 2
|| !is_numeric($major_version)
|| ($version_parts_count === 3 && !is_numeric($version_parts[1]))
// The only case where a non-numeric version part other the extra part is
// allowed is in development versions like 8.x-1.x-dev, 1.2.x-dev or
// 1.x-dev.
|| (!is_numeric($last_part_split[0]) && $last_part_split !== 'x' && $version_extra !== 'dev')) {
throw new \UnexpectedValueException("Unexpected version number in: $original_version");
}
return new static($major_version, $version_extra);
}
/**
* Constructs a ModuleVersion object.
*
* @param string $major_version
* The major version.
* @param string|null $version_extra
* The extra version string.
*/
private function __construct($major_version, $version_extra) {
$this->majorVersion = $major_version;
$this->versionExtra = $version_extra;
}
/**
* Constructs a module version object from a support branch.
*
* This can be used to determine the major version of the branch.
* ::getVersionExtra() will always return NULL for branches.
*
* @param string $branch
* The support branch.
*
* @return \Drupal\update\ModuleVersion
* The module version instance.
*/
public static function createFromSupportBranch($branch) {
if (substr($branch, -1) !== '.') {
throw new \UnexpectedValueException("Invalid support branch: $branch");
}
return static::createFromVersionString($branch . '0');
}
/**
* Gets the major version.
*
* @return string
* The major version.
*/
public function getMajorVersion() {
return $this->majorVersion;
}
/**
* Gets the version extra string at the end of the version number.
*
* @return string|null
* The version extra string if available, or otherwise NULL.
*/
public function getVersionExtra() {
return $this->versionExtra;
}
}
<?php
namespace Drupal\update;
use Composer\Semver\Semver;
use Composer\Semver\VersionParser;
use Drupal\Core\StringTranslation\StringTranslationTrait;
/**
* Utility class to set core compatibility messages for project releases.
*
* @internal
* This class implements logic used by update_calculate_project_status(). It
* should not be called directly.
*/
final class ProjectCoreCompatibility {
use StringTranslationTrait;
/**
* The currently installed version of Drupal core.
*
* @var string
*/
protected $existingCoreVersion;
/**
* Cache of core versions that are available for updates.
*
* @var string[]
*/
protected $possibleCoreUpdateVersions;
/**
* Cache of core compatibility messages per core version constraint.
*
* Keys are core version constraint strings, values are human-readable
* messages about the versions of core that version constraint maps to.
*
* This list is cached since many project releases will use the same core
* compatibility constraint.
*
* @var string[]
*/
protected $compatibilityMessages = [];
/**
* Constructs a ProjectCoreCompatibility object.
*
* @param array $core_data
* The project data for Drupal core as returned by
* \Drupal\update\UpdateManagerInterface::getProjects() and then processed
* by update_process_project_info() and
* update_calculate_project_update_status().
* @param array $core_releases
* The Drupal core available releases.
*
* @see \Drupal\update\UpdateManagerInterface::getProjects()
* @see update_process_project_info()
* @see update_calculate_project_update_status()
*/
public function __construct(array $core_data, array $core_releases) {
if (isset($core_data['existing_version'])) {
$this->existingCoreVersion = $core_data['existing_version'];
$this->possibleCoreUpdateVersions = $this->getPossibleCoreUpdateVersions($core_releases);
}
}
/**
* Gets the core versions that should be considered for compatibility ranges.
*
* @param array $core_releases
* The Drupal core available releases.
*
* @return string[]
* The core version numbers that are possible to update the site to.
*/
protected function getPossibleCoreUpdateVersions(array $core_releases) {
if (!isset($core_releases[$this->existingCoreVersion])) {
// If we can't determine the existing version of core then we can't
// calculate the core compatibility of a given release based on core
// versions after the existing version.
return [];
}
$core_release_versions = array_keys($core_releases);
$possible_core_update_versions = Semver::satisfiedBy($core_release_versions, '>= ' . $this->existingCoreVersion);
$possible_core_update_versions = Semver::sort($possible_core_update_versions);
$possible_core_update_versions = array_filter($possible_core_update_versions, function ($version) {
return VersionParser::parseStability($version) === 'stable';
});
return $possible_core_update_versions;
}
/**
* Sets core compatibility messages for project releases.
*
* @param array &$project_data
* The project data as returned by
* \Drupal\update\UpdateManagerInterface::getProjects() and then processed
* by update_process_project_info() and
* update_calculate_project_update_status(). If set, the following keys are
* used in this method:
* - recommended (string): A project version number.
* - latest_version (string): A project version number.
* - also (string[]): Project version numbers.
* - releases (array[]): An array where the keys are project version numbers
* and the values are arrays of project release information.
* - security updates (array[]): An array of project release information.
*
* @see \Drupal\update\UpdateManagerInterface::getProjects()
* @see update_process_project_info()
* @see update_calculate_project_update_status()
*/
public function setReleaseMessage(array &$project_data) {
if (empty($this->possibleCoreUpdateVersions)) {
return;
}
// Get the various releases that will need to have core compatibility
// messages added to them.
$releases_to_set = [];
$versions = [];
if (!empty($project_data['recommended'])) {
$versions[] = $project_data['recommended'];
}
if (!empty($project_data['latest_version'])) {
$versions[] = $project_data['latest_version'];
}
if (!empty($project_data['also'])) {
$versions = array_merge($versions, $project_data['also']);
}
foreach ($versions as $version) {
if (isset($project_data['releases'][$version])) {
$releases_to_set[] = &$project_data['releases'][$version];
}
}
if (!empty($project_data['security updates'])) {
foreach ($project_data['security updates'] as &$security_update) {
$releases_to_set[] = &$security_update;
}
}
foreach ($releases_to_set as &$release) {
if (!empty($release['core_compatibility'])) {
$release['core_compatible'] = $this->isCoreCompatible($release['core_compatibility']);
$release['core_compatibility_message'] = $this->createMessageFromCoreCompatibility($release['core_compatibility']);
}
}
}
/**
* Determines if a release is compatible with the currently installed core.
*
* @param string $core_compatibility_constraint
* A semantic version constraint.
*
* @return bool
* TRUE if the given constraint is satisfied by the currently installed
* version of Drupal core, otherwise FALSE.
*/
protected function isCoreCompatible($core_compatibility_constraint) {
return Semver::satisfies($this->existingCoreVersion, $core_compatibility_constraint);
}
/**
* Creates core a compatibility message from a semantic version constraint.
*
* @param string $core_compatibility_constraint
* A semantic version constraint.
*
* @return string
* The core compatibility message.
*/
protected function createMessageFromCoreCompatibility($core_compatibility_constraint) {
if (!isset($this->compatibilityMessages[$core_compatibility_constraint])) {
$core_compatibility_ranges = $this->getCompatibilityRanges($core_compatibility_constraint);
$range_messages = [];
foreach ($core_compatibility_ranges as $core_compatibility_range) {
if (count($core_compatibility_range) === 2) {
$range_messages[] = $this->t('@low_version_number to @high_version_number', ['@low_version_number' => $core_compatibility_range[0], '@high_version_number' => $core_compatibility_range[1]]);
}
else {
$range_messages[] = $core_compatibility_range[0];
}
}
$this->compatibilityMessages[$core_compatibility_constraint] = $this->t('Requires Drupal core:') . ' ' . implode(', ', $range_messages);
}
return $this->compatibilityMessages[$core_compatibility_constraint];
}
/**
* Gets the compatibility ranges for a semantic version constraint.
*
* @param string $core_compatibility_constraint
* A semantic version constraint.
*
* @return array[]
* An array compatibility ranges. If a range array has 2 elements then this
* denotes a range of compatibility between and including the 2 versions. If
* the range has 1 element then it denotes compatibility with a single
* version.
*/
protected function getCompatibilityRanges($core_compatibility_constraint) {
$compatibility_ranges = [];
foreach ($this->possibleCoreUpdateVersions as $possible_core_update_version) {
if (Semver::satisfies($possible_core_update_version, $core_compatibility_constraint)) {
if (empty($range)) {
$range[] = $possible_core_update_version;
}
else {
$range[1] = $possible_core_update_version;
}
}
else {
// If core version does not satisfy the constraint and there is a non
// empty range, add it to the list of ranges.
if (!empty($range)) {
$compatibility_ranges[] = $range;
// Start a new range.
$range = [];
}
}
}
if (!empty($range)) {
$compatibility_ranges[] = $range;
}
return $compatibility_ranges;
}
}
<?php
namespace Drupal\update;
/**
* Calculates a project's security coverage information.
*
* @internal
* This class implements logic to determine security coverage for Drupal core
* according to Drupal core security policy. It should not be called directly.
*/
final class ProjectSecurityData {
/**
* The number of minor versions of Drupal core that receive security coverage.
*
* For example, if this value is 2 and the existing version is 9.0.1, the
* 9.0.x branch will receive security coverage until the release of version
* 9.2.0.
*
* @todo In https://www.drupal.org/node/2998285 determine if we want this
* policy to be expressed in the updates.drupal.org feed, instead of relying
* on a hard-coded constant.
*
* @see https://www.drupal.org/core/release-cycle-overview
*/
const CORE_MINORS_WITH_SECURITY_COVERAGE = 2;
/**
* Define constants for versions with security coverage end dates.
*
* Two types of constants are supported:
* - SECURITY_COVERAGE_END_DATE_[VERSION_MAJOR]_[VERSION_MINOR]: A date in
* 'Y-m-d' or 'Y-m' format.
* - SECURITY_COVERAGE_ENDING_WARN_DATE_[VERSION_MAJOR]_[VERSION_MINOR]: A
* date in 'Y-m-d' format.
*
* @see \Drupal\update\ProjectSecurityRequirement::getDateEndRequirement()
*/
const SECURITY_COVERAGE_END_DATE_8_8 = '2020-12-02';
const SECURITY_COVERAGE_ENDING_WARN_DATE_8_8 = '2020-06-02';
const SECURITY_COVERAGE_END_DATE_8_9 = '2021-11';
/**
* The existing (currently installed) version of the project.
*
* Because this class only handles the Drupal core project, values will be
* semantic version numbers such as 8.8.0, 8.8.0-alpha1, or 9.0.0.
*
* @var string|null
*/
protected $existingVersion;
/**
* Releases as returned by update_get_available().
*
* @var array
*
* Each release item in the array has metadata about that release. This class
* uses the keys:
* - status (string): The status of the release.
* - version (string): The version number of the release.
*
* @see update_get_available()
*/
protected $releases;
/**
* Constructs a ProjectSecurityData object.
*
* @param string $existing_version
* The existing (currently installed) version of the project.
* @param array $releases
* Project releases as returned by update_get_available().
*/
private function __construct($existing_version = NULL, array $releases = []) {
$this->existingVersion = $existing_version;
$this->releases = $releases;
}
/**
* Creates a ProjectSecurityData object from project data and releases.
*
* @param array $project_data
* Project data from Drupal\update\UpdateManagerInterface::getProjects() and
* processed by update_process_project_info().
* @param array $releases
* Project releases as returned by update_get_available().
*
* @return static
*/
public static function createFromProjectDataAndReleases(array $project_data, array $releases) {
if (!($project_data['project_type'] === 'core' && $project_data['name'] === 'drupal')) {
// Only Drupal core has an explicit coverage range.
return new static();
}
return new static($project_data['existing_version'], $releases);
}
/**
* Gets the security coverage information for a project.
*
* Currently only Drupal core is supported.
*
* @return array
* The security coverage information, or an empty array if no security
* information is available for the project. If security coverage is based
* on release of a specific version, the array will have the following
* keys:
* - security_coverage_end_version (string): The minor version the existing
* version will receive security coverage until.
* - additional_minors_coverage (int): The number of additional minor
* versions the existing version will receive security coverage.
* If the security coverage is based on a specific date, the array will have
* the following keys:
* - security_coverage_end_date (string): The month or date security
* coverage will end for the existing version. It can be in either
* 'YYYY-MM' or 'YYYY-MM-DD' format.
* - (optional) security_coverage_ending_warn_date (string): The date, in
* the format 'YYYY-MM-DD', after which a warning should be displayed
* about upgrading to another version.
*/
public function getCoverageInfo() {
if (empty($this->releases[$this->existingVersion])) {
// If the existing version does not have a release, we cannot get the
// security coverage information.
return [];
}
$info = [];
$existing_release_version = ModuleVersion::createFromVersionString($this->existingVersion);
// Check if the installed version has a specific end date defined.
$version_suffix = $existing_release_version->getMajorVersion() . '_' . $this->getSemanticMinorVersion($this->existingVersion);
if (defined("self::SECURITY_COVERAGE_END_DATE_$version_suffix")) {
$info['security_coverage_end_date'] = constant("self::SECURITY_COVERAGE_END_DATE_$version_suffix");
$info['security_coverage_ending_warn_date'] =
defined("self::SECURITY_COVERAGE_ENDING_WARN_DATE_$version_suffix")
? constant("self::SECURITY_COVERAGE_ENDING_WARN_DATE_$version_suffix")
: NULL;
}
elseif ($security_coverage_until_version = $this->getSecurityCoverageUntilVersion()) {
$info['security_coverage_end_version'] = $security_coverage_until_version;
$info['additional_minors_coverage'] = $this->getAdditionalSecurityCoveredMinors($security_coverage_until_version);
}
return $info;
}
/**
* Gets the release the current minor will receive security coverage until.
*
* For the sake of example, assume that the currently installed version of
* Drupal is 8.7.11 and that static::CORE_MINORS_WITH_SECURITY_COVERAGE is 2.
* When Drupal 8.9.0 is released, the supported minor versions will be 8.8
* and 8.9. At that point, Drupal 8.7 will no longer have security coverage.
* Therefore, this function would return "8.9.0".
*
* @todo In https://www.drupal.org/node/2998285 determine how we will know
* what the final minor release of a particular major version will be. This
* method should not return a version beyond that minor.
*
* @return string|null
* The version the existing version will receive security coverage until or
* NULL if this cannot be determined.
*/
private function getSecurityCoverageUntilVersion() {
$existing_release_version = ModuleVersion::createFromVersionString($this->existingVersion);
if (!empty($existing_release_version->getVersionExtra())) {
// Only full releases receive security coverage.
return NULL;
}
return $existing_release_version->getMajorVersion() . '.'
. ($this->getSemanticMinorVersion($this->existingVersion) + static::CORE_MINORS_WITH_SECURITY_COVERAGE)
. '.0';
}
/**
* Gets the number of additional minor releases with security coverage.
*
* This function compares the currently installed (existing) version of
* the project with two things:
* - The latest available official release of that project.
* - The target minor release where security coverage for the current release
* should expire. This target release is determined by
* getSecurityCoverageUntilVersion().
*
* For the sake of example, assume that the currently installed version of
* Drupal is 8.7.11 and that static::CORE_MINORS_WITH_SECURITY_COVERAGE is 2.
*
* Before the release of Drupal 8.8.0, this function would return 2.
*
* After the release of Drupal 8.8.0 and before the release of 8.9.0, this
* function would return 1 to indicate that the next minor version release
* will end security coverage for 8.7.
*
* When Drupal 8.9.0 is released, this function would return 0 to indicate
* that security coverage is over for 8.7.
*
* If the currently installed version is 9.0.0, and there is no 9.1.0 release
* yet, the function would return 2. Once 9.1.0 is out, it would return 1.
* When 9.2.0 is released, it would again return 0.
*
* Note: callers should not test this function's return value with empty()
* since 0 is a valid return value that has different meaning than NULL.
*
* @param string $security_covered_version
* The version until which the existing version receives security coverage.
*
* @return int|null
* The number of additional minor releases that receive security coverage,
* or NULL if this cannot be determined.
*
* @see \Drupal\update\ProjectSecurityData\getSecurityCoverageUntilVersion()
*/
private function getAdditionalSecurityCoveredMinors($security_covered_version) {
$security_covered_version_major = ModuleVersion::createFromVersionString($security_covered_version)->getMajorVersion();
$security_covered_version_minor = $this->getSemanticMinorVersion($security_covered_version);
foreach ($this->releases as $release) {
$release_version = ModuleVersion::createFromVersionString($release['version']);
if ($release_version->getMajorVersion() === $security_covered_version_major && $release['status'] === 'published' && !$release_version->getVersionExtra()) {
// The releases are ordered with the most recent releases first.
// Therefore, if we have found a published, official release with the
// same major version as $security_covered_version, then this release
// can be used to determine the latest minor.
$latest_minor = $this->getSemanticMinorVersion($release['version']);
break;
}
}
// If $latest_minor is set, we know that $security_covered_version_minor and
// $latest_minor have the same major version. Therefore, we can subtract to
// determine the number of additional minor releases with security coverage.
return isset($latest_minor) ? $security_covered_version_minor - $latest_minor : NULL;
}
/**
* Gets the minor version for a semantic version string.
*
* @param string $version
* The semantic version string.
*
* @return int
* The minor version as an integer.
*/
private function getSemanticMinorVersion($version) {
return (int) (explode('.', $version)[1]);
}
}
<?php
namespace Drupal\update;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Url;
/**
* Class for generating a project's security requirement.
*
* @see update_requirements()
*
* @internal
* This class implements logic to determine security coverage for Drupal core
* according to Drupal core security policy. It should not be called directly.
*/
final class ProjectSecurityRequirement {
use StringTranslationTrait;
/**
* The project title.
*
* @var string|null
*/
protected $projectTitle;
/**
* Security coverage information for the project.
*
* @var array
*
* @see \Drupal\update\ProjectSecurityData::getCoverageInfo()
*/
private $securityCoverageInfo;
/**
* The next version after the installed version in the format [MAJOR].[MINOR].
*
* @var string|null
*/
private $nextMajorMinorVersion;
/**
* The existing (currently installed) version in the format [MAJOR].[MINOR].
*
* @var string|null
*/
private $existingMajorMinorVersion;
/**
* Constructs a ProjectSecurityRequirement object.
*
* @param string|null $project_title
* The project title.
* @param array $security_coverage_info
* Security coverage information as set by
* \Drupal\update\ProjectSecurityData::getCoverageInfo().
* @param string|null $existing_major_minor_version
* The existing (currently installed) version in the format [MAJOR].[MINOR].
* @param string|null $next_major_minor_version
* The next version after the installed version in the format
* [MAJOR].[MINOR].
*/
private function __construct($project_title = NULL, array $security_coverage_info = [], $existing_major_minor_version = NULL, $next_major_minor_version = NULL) {
$this->projectTitle = $project_title;
$this->securityCoverageInfo = $security_coverage_info;
$this->existingMajorMinorVersion = $existing_major_minor_version;
$this->nextMajorMinorVersion = $next_major_minor_version;
}
/**
* Creates a ProjectSecurityRequirement object from project data.
*
* @param array $project_data
* Project data from Drupal\update\UpdateManagerInterface::getProjects().
* The 'security_coverage_info' key should be set by
* calling \Drupal\update\ProjectSecurityData::getCoverageInfo() before
* calling this method. The following keys are used in this method:
* - existing_version (string): The version of the project that is installed
* on the site.
* - project_type (string): The type of project.
* - name (string): The project machine name.
* - title (string): The project title.
* @param array $security_coverage_info
* The security coverage information as returned by
* \Drupal\update\ProjectSecurityData::getCoverageInfo().
*
* @return static
*
* @see \Drupal\update\UpdateManagerInterface::getProjects()
* @see \Drupal\update\ProjectSecurityData::getCoverageInfo()
* @see update_process_project_info()
*/
public static function createFromProjectDataAndSecurityCoverageInfo(array $project_data, array $security_coverage_info) {
if ($project_data['project_type'] !== 'core' || $project_data['name'] !== 'drupal' || empty($security_coverage_info)) {
return new static();
}
if (isset($project_data['existing_version'])) {
list($major, $minor) = explode('.', $project_data['existing_version']);
$existing_version = "$major.$minor";
$next_version = "$major." . ((int) $minor + 1);
return new static($project_data['title'], $security_coverage_info, $existing_version, $next_version);
}
return new static($project_data['title'], $security_coverage_info);
}
/**
* Gets the security coverage requirement, if any.
*
* @return array
* Requirements array as specified by hook_requirements(), or an empty array
* if no requirements can be determined.
*/
public function getRequirement() {
if (isset($this->securityCoverageInfo['security_coverage_end_version'])) {
$requirement = $this->getVersionEndRequirement();
}
elseif (isset($this->securityCoverageInfo['security_coverage_end_date'])) {
$requirement = $this->getDateEndRequirement();
}
else {
return [];
}
$requirement['title'] = $this->t('Drupal core security coverage');
return $requirement;
}
/**
* Gets the requirements based on security coverage until a specific version.
*
* @return array
* Requirements array as specified by hook_requirements().
*/
private function getVersionEndRequirement() {
$requirement = [];
if ($security_coverage_message = $this->getVersionEndCoverageMessage()) {
$requirement['description'] = $security_coverage_message;
if ($this->securityCoverageInfo['additional_minors_coverage'] > 0) {
$requirement['value'] = $this->t(
'Covered until @end_version',
['@end_version' => $this->securityCoverageInfo['security_coverage_end_version']]
);
$requirement['severity'] = $this->securityCoverageInfo['additional_minors_coverage'] > 1 ? REQUIREMENT_INFO : REQUIREMENT_WARNING;
}
else {
$requirement['value'] = $this->t('Coverage has ended');
$requirement['severity'] = REQUIREMENT_ERROR;
}
}
return $requirement;
}
/**
* Gets the message for additional minor version security coverage.
*
* @return array[]
* A render array containing security coverage message.
*
* @see \Drupal\update\ProjectSecurityData::getCoverageInfo()
*/
private function getVersionEndCoverageMessage() {
if ($this->securityCoverageInfo['additional_minors_coverage'] > 0) {
// If the installed minor version will receive security coverage until
// newer minor versions are released, inform the user.
if ($this->securityCoverageInfo['additional_minors_coverage'] === 1) {
// If the installed minor version will only receive security coverage
// for 1 newer minor core version, encourage the site owner to update
// soon.
$message['coverage_message'] = [
'#markup' => $this->t(
'<a href=":update_status_report">Update to @next_minor or higher</a> soon to continue receiving security updates.',
[
':update_status_report' => Url::fromRoute('update.status')->toString(),
'@next_minor' => $this->nextMajorMinorVersion,
]
),
'#suffix' => ' ',
];
}
}
else {
// Because the current minor version no longer has security coverage,
// advise the site owner to update.
$message['coverage_message'] = [
'#markup' => $this->getVersionNoSecurityCoverageMessage(),
'#suffix' => ' ',
];
}
$message['release_cycle_link'] = [
'#markup' => $this->getReleaseCycleLink(),
];
return $message;
}
/**
* Gets the security coverage requirement based on an end date.
*
* @return array
* Requirements array as specified by hook_requirements().
*/
private function getDateEndRequirement() {
$requirement = [];
/** @var \Drupal\Component\Datetime\Time $time */
$time = \Drupal::service('datetime.time');
/** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */
$date_formatter = \Drupal::service('date.formatter');
// 'security_coverage_end_date' will either be in format 'Y-m-d' or 'Y-m'.
if (substr_count($this->securityCoverageInfo['security_coverage_end_date'], '-') === 2) {
$date_format = 'Y-m-d';
$full_security_coverage_end_date = $this->securityCoverageInfo['security_coverage_end_date'];
}
else {
$date_format = 'Y-m';
// If the date does not include a day, use '15'. When calling
// \DateTime::createFromFormat() the current day will be used if one is
// not provided. This may cause the month to be wrong at the beginning or
// end of the month. '15' will never be displayed because we are using the
// 'Y-m' format.
$full_security_coverage_end_date = $this->securityCoverageInfo['security_coverage_end_date'] . '-15';
}
$comparable_request_date = $date_formatter->format($time->getRequestTime(), 'custom', $date_format);
if ($this->securityCoverageInfo['security_coverage_end_date'] <= $comparable_request_date) {
// Security coverage is over.
$requirement['value'] = $this->t('Coverage has ended');
$requirement['severity'] = REQUIREMENT_ERROR;
$requirement['description']['coverage_message'] = [
'#markup' => $this->getVersionNoSecurityCoverageMessage(),
'#suffix' => ' ',
];
}
else {
$security_coverage_end_timestamp = \DateTime::createFromFormat('Y-m-d', $full_security_coverage_end_date)->getTimestamp();
$output_date_format = $date_format === 'Y-m-d' ? 'Y-M-d' : 'Y-M';
$formatted_end_date = $date_formatter
->format($security_coverage_end_timestamp, 'custom', $output_date_format);
$translation_arguments = ['@date' => $formatted_end_date];
$requirement['value'] = $this->t('Covered until @date', $translation_arguments);
$requirement['severity'] = REQUIREMENT_INFO;
// 'security_coverage_ending_warn_date' will always be in the format
// 'Y-m-d'.
$request_date = $date_formatter->format($time->getRequestTime(), 'custom', 'Y-m-d');
if (!empty($this->securityCoverageInfo['security_coverage_ending_warn_date']) && $this->securityCoverageInfo['security_coverage_ending_warn_date'] <= $request_date) {
$requirement['description']['coverage_message'] = [
'#markup' => $this->t('Update to a supported minor version soon to continue receiving security updates.'),
'#suffix' => ' ',
];
$requirement['severity'] = REQUIREMENT_WARNING;
}
}
$requirement['description']['release_cycle_link'] = ['#markup' => $this->getReleaseCycleLink()];
return $requirement;
}
/**
* Gets the formatted message for a project with no security coverage.
*
* @return string
* The message for a version with no security coverage.
*/
private function getVersionNoSecurityCoverageMessage() {
return $this->t(
'<a href=":update_status_report">Update to a supported minor</a> as soon as possible to continue receiving security updates.',
[':update_status_report' => Url::fromRoute('update.status')->toString()]
);
}
/**
* Gets a link the release cycle page on drupal.org.
*
* @return string
* A link to the release cycle page on drupal.org.
*/
private function getReleaseCycleLink() {
return $this->t(
'Visit the <a href=":url">release cycle overview</a> for more information on supported releases.',
[':url' => 'https://www.drupal.org/core/release-cycle-overview']
);
}
}
<?php
namespace Drupal\update\Tests;
@trigger_error(__NAMESPACE__ . '\UpdateTestBase is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\update\Functional\UpdateTestBase', E_USER_DEPRECATED);
use Drupal\Core\DrupalKernel;
use Drupal\Core\Link;
use Drupal\Core\Url;
use Drupal\simpletest\WebTestBase;
/**
* Defines some shared functions used by all update tests.
*
* The overarching methodology of these tests is we need to compare a given
* state of installed modules and themes (e.g., version, project grouping,
* timestamps, etc) against a current state of what the release history XML
* files we fetch say is available. We have dummy XML files (in the
* core/modules/update/tests directory) that describe various scenarios of
* what's available for different test projects, and we have dummy .info file
* data (specified via hook_system_info_alter() in the update_test helper
* module) describing what's currently installed. Each test case defines a set
* of projects to install, their current state (via the
* 'update_test_system_info' variable) and the desired available update data
* (via the 'update_test_xml_map' variable), and then performs a series of
* assertions that the report matches our expectations given the specific
* initial state and availability scenario.
*
* @deprecated in drupal:8.?.? and is removed from drupal:9.0.0.
* Use \Drupal\Tests\update\Functional\UpdateTestBase instead.
*/
abstract class UpdateTestBase extends WebTestBase {
protected function setUp() {
parent::setUp();
// Change the root path which Update Manager uses to install and update
// projects to be inside the testing site directory. See
// \Drupal\update\UpdateRootFactory::get() for equivalent changes to the
// test child site.
$request = \Drupal::request();
$update_root = $this->container->get('update.root') . '/' . DrupalKernel::findSitePath($request);
$this->container->set('update.root', $update_root);
\Drupal::setContainer($this->container);
// Create the directories within the root path within which the Update
// Manager will install projects.
foreach (drupal_get_updaters() as $updater_info) {
$updater = $updater_info['class'];
$install_directory = $update_root . '/' . $updater::getRootDirectoryRelativePath();
if (!is_dir($install_directory)) {
mkdir($install_directory);
}
}
}
/**
* Refreshes the update status based on the desired available update scenario.
*
* @param $xml_map
* Array that maps project names to availability scenarios to fetch. The key
* '#all' is used if a project-specific mapping is not defined.
* @param $url
* (optional) A string containing the URL to fetch update data from.
* Defaults to 'update-test'.
*
* @see \Drupal\update_test\Controller\UpdateTestController::updateTest()
*/
protected function refreshUpdateStatus($xml_map, $url = 'update-test') {
// Tell the Update Manager module to fetch from the URL provided by
// update_test module.
$this->config('update.settings')->set('fetch.url', Url::fromUri('base:' . $url, ['absolute' => TRUE])->toString())->save();
// Save the map for UpdateTestController::updateTest() to use.
$this->config('update_test.settings')->set('xml_map', $xml_map)->save();
// Manually check the update status.
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
}
/**
* Runs a series of assertions that are applicable to all update statuses.
*/
protected function standardTests() {
$this->assertRaw('<h3>' . t('Drupal core') . '</h3>');
$this->assertRaw(Link::fromTextAndUrl(t('Drupal'), Url::fromUri('http://example.com/project/drupal'))->toString(), 'Link to the Drupal project appears.');
$this->assertNoText(t('No available releases found'));
}
}
<?php
namespace Drupal\update;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\RequestException;
/**
* Fetches project information from remote locations.
*/
class UpdateFetcher implements UpdateFetcherInterface {
use DependencySerializationTrait;
/**
* URL to check for updates, if a given project doesn't define its own.
*/
const UPDATE_DEFAULT_URL = 'http://updates.drupal.org/release-history';
/**
* The fetch url configured in the update settings.
*
* @var string
*/
protected $fetchUrl;
/**
* The update settings
*
* @var \Drupal\Core\Config\Config
*/
protected $updateSettings;
/**
* The HTTP client to fetch the feed data with.
*
* @var \GuzzleHttp\ClientInterface
*/
protected $httpClient;
/**
* Constructs a UpdateFetcher.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
* @param \GuzzleHttp\ClientInterface $http_client
* A Guzzle client object.
*/
public function __construct(ConfigFactoryInterface $config_factory, ClientInterface $http_client) {
$this->fetchUrl = $config_factory->get('update.settings')->get('fetch.url');
$this->httpClient = $http_client;
$this->updateSettings = $config_factory->get('update.settings');
}
/**
* {@inheritdoc}
*/
public function fetchProjectData(array $project, $site_key = '') {
$url = $this->buildFetchUrl($project, $site_key);
$data = '';
try {
$data = (string) $this->httpClient
->get($url, ['headers' => ['Accept' => 'text/xml']])
->getBody();
}
catch (RequestException $exception) {
watchdog_exception('update', $exception);
}
return $data;
}
/**
* {@inheritdoc}
*/
public function buildFetchUrl(array $project, $site_key = '') {
$name = $project['name'];
$url = $this->getFetchBaseUrl($project);
$url .= '/' . $name . '/current';
// Only append usage information if we have a site key and the project is
// enabled. We do not want to record usage statistics for disabled projects.
if (!empty($site_key) && (strpos($project['project_type'], 'disabled') === FALSE)) {
// Append the site key.
$url .= (strpos($url, '?') !== FALSE) ? '&' : '?';
$url .= 'site_key=';
$url .= rawurlencode($site_key);
// Append the version.
if (!empty($project['info']['version'])) {
$url .= '&version=';
$url .= rawurlencode($project['info']['version']);
}
// Append the list of modules or themes enabled.
$list = array_keys($project['includes']);
$url .= '&list=';
$url .= rawurlencode(implode(',', $list));
}
return $url;
}
/**
* {@inheritdoc}
*/
public function getFetchBaseUrl($project) {
if (isset($project['info']['project status url'])) {
$url = $project['info']['project status url'];
}
else {
$url = $this->fetchUrl;
if (empty($url)) {
$url = static::UPDATE_DEFAULT_URL;
}
}
return $url;
}
}
<?php
namespace Drupal\update;
/**
* Fetches project information from remote locations.
*/
interface UpdateFetcherInterface {
/**
* Project's status cannot be checked.
*/
const NOT_CHECKED = -1;
/**
* No available update data was found for project.
*/
const UNKNOWN = -2;
/**
* There was a failure fetching available update data for this project.
*/
const NOT_FETCHED = -3;
/**
* We need to (re)fetch available update data for this project.
*/
const FETCH_PENDING = -4;
/**
* Returns the base of the URL to fetch available update data for a project.
*
* @param array $project
* The array of project information from
* \Drupal\update\UpdateManager::getProjects().
*
* @return string
* The base of the URL used for fetching available update data. This does
* not include the path elements to specify a particular project, version,
* site_key, etc.
*/
public function getFetchBaseUrl($project);
/**
* Retrieves the project information.
*
* @param array $project
* The array of project information from
* \Drupal\update\UpdateManager::getProjects().
* @param string $site_key
* (optional) The anonymous site key hash. Defaults to an empty string.
*
* @return string
* The project information fetched as string. Empty string upon failure.
*/
public function fetchProjectData(array $project, $site_key = '');
/**
* Generates the URL to fetch information about project updates.
*
* This figures out the right URL to use, based on the project's .info.yml
* file and the global defaults. Appends optional query arguments when the
* site is configured to report usage stats.
*
* @param array $project
* The array of project information from
* \Drupal\update\UpdateManager::getProjects().
* @param string $site_key
* (optional) The anonymous site key hash. Defaults to an empty string.
*
* @return string
* The URL for fetching information about updates to the specified project.
*
* @see \Drupal\update\UpdateProcessor::fetchData()
* @see \Drupal\update\UpdateProcessor::processFetchTask()
* @see \Drupal\update\UpdateManager::getProjects()
*/
public function buildFetchUrl(array $project, $site_key = '');
}
<?php
namespace Drupal\update;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Extension\ThemeHandlerInterface;
use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Utility\ProjectInfo;
/**
* Default implementation of UpdateManagerInterface.
*/
class UpdateManager implements UpdateManagerInterface {
use DependencySerializationTrait;
use StringTranslationTrait;
/**
* The update settings
*
* @var \Drupal\Core\Config\Config
*/
protected $updateSettings;
/**
* Module Handler Service.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* Update Processor Service.
*
* @var \Drupal\update\UpdateProcessorInterface
*/
protected $updateProcessor;
/**
* An array of installed and enabled projects.
*
* @var array
*/
protected $projects;
/**
* The key/value store.
*
* @var \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface
*/
protected $keyValueStore;
/**
* Update available releases key/value store.
*
* @var \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface
*/
protected $availableReleasesTempStore;
/**
* The theme handler.
*
* @var \Drupal\Core\Extension\ThemeHandlerInterface
*/
protected $themeHandler;
/**
* The module extension list.
*
* @var \Drupal\Core\Extension\ModuleExtensionList
*/
protected $moduleExtensionList;
/**
* Constructs a UpdateManager.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The Module Handler service
* @param \Drupal\update\UpdateProcessorInterface $update_processor
* The Update Processor service.
* @param \Drupal\Core\StringTranslation\TranslationInterface $translation
* The translation service.
* @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_expirable_factory
* The expirable key/value factory.
* @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler
* The theme handler.
* @param \Drupal\Core\Extension\ModuleExtensionList|null $extension_list_module
* The module extension list. This is left optional for BC reasons, but the
* optional usage is deprecated and will become required in Drupal 9.0.0.
*/
public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, UpdateProcessorInterface $update_processor, TranslationInterface $translation, KeyValueFactoryInterface $key_value_expirable_factory, ThemeHandlerInterface $theme_handler, ModuleExtensionList $extension_list_module = NULL) {
$this->updateSettings = $config_factory->get('update.settings');
$this->moduleHandler = $module_handler;
$this->updateProcessor = $update_processor;
$this->stringTranslation = $translation;
$this->keyValueStore = $key_value_expirable_factory->get('update');
$this->themeHandler = $theme_handler;
$this->availableReleasesTempStore = $key_value_expirable_factory->get('update_available_releases');
$this->projects = [];
if ($extension_list_module === NULL) {
@trigger_error('Invoking the UpdateManager constructor without the module extension list parameter is deprecated in Drupal 8.8.0 and will no longer be supported in Drupal 9.0.0. The extension list parameter is now required in the ConfigImporter constructor. See https://www.drupal.org/node/2943918', E_USER_DEPRECATED);
$extension_list_module = \Drupal::service('extension.list.module');
}
$this->moduleExtensionList = $extension_list_module;
}
/**
* {@inheritdoc}
*/
public function refreshUpdateData() {
// Since we're fetching new available update data, we want to clear
// of both the projects we care about, and the current update status of the
// site. We do *not* want to clear the cache of available releases just yet,
// since that data (even if it's stale) can be useful during
// \Drupal\update\UpdateManager::getProjects(); for example, to modules
// that implement hook_system_info_alter() such as cvs_deploy.
$this->keyValueStore->delete('update_project_projects');
$this->keyValueStore->delete('update_project_data');
$projects = $this->getProjects();
// Now that we have the list of projects, we should also clear the available
// release data, since even if we fail to fetch new data, we need to clear
// out the stale data at this point.
$this->availableReleasesTempStore->deleteAll();
foreach ($projects as $project) {
$this->updateProcessor->createFetchTask($project);
}
}
/**
* {@inheritdoc}
*/
public function getProjects() {
if (empty($this->projects)) {
// Retrieve the projects from storage, if present.
$this->projects = $this->projectStorage('update_project_projects');
if (empty($this->projects)) {
// Still empty, so we have to rebuild.
$module_data = $this->moduleExtensionList->reset()->getList();
$theme_data = $this->themeHandler->rebuildThemeData();
$project_info = new ProjectInfo();
$project_info->processInfoList($this->projects, $module_data, 'module', TRUE);
$project_info->processInfoList($this->projects, $theme_data, 'theme', TRUE);
if ($this->updateSettings->get('check.disabled_extensions')) {
$project_info->processInfoList($this->projects, $module_data, 'module', FALSE);
$project_info->processInfoList($this->projects, $theme_data, 'theme', FALSE);
}
// Allow other modules to alter projects before fetching and comparing.
$this->moduleHandler->alter('update_projects', $this->projects);
// Store the site's project data for at most 1 hour.
$this->keyValueStore->setWithExpire('update_project_projects', $this->projects, 3600);
}
}
return $this->projects;
}
/**
* {@inheritdoc}
*/
public function projectStorage($key) {
$projects = [];
// On certain paths, we should clear the data and recompute the projects for
// update status of the site to avoid presenting stale information.
$route_names = [
'update.theme_update',
'system.modules_list',
'system.theme_install',
'update.module_update',
'update.module_install',
'update.status',
'update.report_update',
'update.report_install',
'update.settings',
'system.status',
'update.manual_status',
'update.confirmation_page',
'system.themes_page',
];
if (in_array(\Drupal::routeMatch()->getRouteName(), $route_names)) {
$this->keyValueStore->delete($key);
}
else {
$projects = $this->keyValueStore->get($key, []);
}
return $projects;
}
/**
* {@inheritdoc}
*/
public function fetchDataBatch(&$context) {
if (empty($context['sandbox']['max'])) {
$context['finished'] = 0;
$context['sandbox']['max'] = $this->updateProcessor->numberOfQueueItems();
$context['sandbox']['progress'] = 0;
$context['message'] = $this->t('Checking available update data ...');
$context['results']['updated'] = 0;
$context['results']['failures'] = 0;
$context['results']['processed'] = 0;
}
// Grab another item from the fetch queue.
for ($i = 0; $i < 5; $i++) {
if ($item = $this->updateProcessor->claimQueueItem()) {
if ($this->updateProcessor->processFetchTask($item->data)) {
$context['results']['updated']++;
$context['message'] = $this->t('Checked available update data for %title.', ['%title' => $item->data['info']['name']]);
}
else {
$context['message'] = $this->t('Failed to check available update data for %title.', ['%title' => $item->data['info']['name']]);
$context['results']['failures']++;
}
$context['sandbox']['progress']++;
$context['results']['processed']++;
$context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
$this->updateProcessor->deleteQueueItem($item);
}
else {
// If the queue is currently empty, we're done. It's possible that
// another thread might have added new fetch tasks while we were
// processing this batch. In that case, the usual 'finished' math could
// get confused, since we'd end up processing more tasks that we thought
// we had when we started and initialized 'max' with numberOfItems(). By
// forcing 'finished' to be exactly 1 here, we ensure that batch
// processing is terminated.
$context['finished'] = 1;
return;
}
}
}
}
<?php
namespace Drupal\update;
/**
* Manages project update information.
*/
interface UpdateManagerInterface {
/**
* Project is missing security update(s).
*/
const NOT_SECURE = 1;
/**
* Current release has been unpublished and is no longer available.
*/
const REVOKED = 2;
/**
* Current release is no longer supported by the project maintainer.
*/
const NOT_SUPPORTED = 3;
/**
* Project has a new release available, but it is not a security release.
*/
const NOT_CURRENT = 4;
/**
* Project is up to date.
*/
const CURRENT = 5;
/**
* Fetches an array of installed and enabled projects.
*
* This is only responsible for generating an array of projects (taking into
* account projects that include more than one module or theme). Other
* information like the specific version and install type (official release,
* dev snapshot, etc) is handled later in update_process_project_info() since
* that logic is only required when preparing the status report, not for
* fetching the available release data.
*
* This array is fairly expensive to construct, since it involves a lot of
* disk I/O, so we store the results. However, since this is not the data
* about available updates fetched from the network, it is acceptable to
* invalidate it somewhat quickly. If we keep this data for very long, site
* administrators are more likely to see incorrect results if they upgrade to
* a newer version of a module or theme but do not visit certain pages that
* automatically clear this data.
*
* @return array
* An associative array of currently enabled projects keyed by the
* machine-readable project short name. Each project contains:
* - name: The machine-readable project short name.
* - info: An array with values from the main .info.yml file for this
* project.
* - name: The human-readable name of the project.
* - package: The package that the project is grouped under.
* - version: The version of the project.
* - project: The Drupal.org project name.
* - datestamp: The date stamp of the project's main .info.yml file.
* - _info_file_ctime: The maximum file change time for all of the
* .info.yml
* files included in this project.
* - datestamp: The date stamp when the project was released, if known.
* - includes: An associative array containing all projects included with
* this project, keyed by the machine-readable short name with the
* human-readable name as value.
* - project_type: The type of project. Allowed values are 'module' and
* 'theme'.
* - project_status: This indicates if the project is enabled and will
* always be TRUE, as the function only returns enabled projects.
*
* @see update_process_project_info()
* @see update_calculate_project_data()
* @see \Drupal\update\UpdateManager::projectStorage()
*/
public function getProjects();
/**
* Processes a step in batch for fetching available update data.
*
* Before calling this method, call
* UpdateManagerInterface::refreshUpdateData() to clear existing update data
* and initiate re-fetching.
*
* @param array $context
* Reference to an array used for Batch API storage.
*
* @see \Drupal\update\UpdateManagerInterface::refreshUpdateData()
*/
public function fetchDataBatch(&$context);
/**
* Clears out all the available update data and initiates re-fetching.
*/
public function refreshUpdateData();
/**
* Retrieves update storage data or empties it.
*
* Two very expensive arrays computed by this module are the list of all
* installed modules and themes (and .info.yml data, project associations,
* etc), and the current status of the site relative to the currently
* available releases. These two arrays are stored and used whenever possible.
* The data is cleared whenever the administrator visits the status report,
* available updates report, or the module or theme administration pages,
* since we should always recompute the most current values on any of those
* pages.
*
* Note: while both of these arrays are expensive to compute (in terms of disk
* I/O and some fairly heavy CPU processing), neither of these is the actual
* data about available updates that we have to fetch over the network from
* updates.drupal.org. That information is stored in the
* 'update_available_releases' collection -- it needs to persist longer than 1
* hour and never get invalidated just by visiting a page on the site.
*
* @param string $key
* The key of data to return. Valid options are 'update_project_data' and
* 'update_project_projects'.
*
* @return array
* The stored value of the $projects array generated by
* update_calculate_project_data() or
* \Drupal\update\UpdateManager::getProjects(), or an empty array when the
* storage is cleared.
* array when the storage is cleared.
*/
public function projectStorage($key);
}
<?php
namespace Drupal\update;
use Drupal\Component\Utility\Crypt;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
use Drupal\Core\State\StateInterface;
use Drupal\Core\PrivateKey;
use Drupal\Core\Queue\QueueFactory;
/**
* Process project update information.
*/
class UpdateProcessor implements UpdateProcessorInterface {
/**
* The update settings
*
* @var \Drupal\Core\Config\Config
*/
protected $updateSettings;
/**
* The UpdateFetcher service.
*
* @var \Drupal\update\UpdateFetcherInterface
*/
protected $updateFetcher;
/**
* The update fetch queue.
*
* @var \Drupal\Core\Queue\QueueInterface
*/
protected $fetchQueue;
/**
* Update key/value store
*
* @var \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface
*/
protected $tempStore;
/**
* Update Fetch Task Store
*
* @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
*/
protected $fetchTaskStore;
/**
* Update available releases store
*
* @var \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface
*/
protected $availableReleasesTempStore;
/**
* Array of release history URLs that we have failed to fetch
*
* @var array
*/
protected $failed;
/**
* The state service.
*
* @var \Drupal\Core\State\StateInterface
*/
protected $stateStore;
/**
* The private key.
*
* @var \Drupal\Core\PrivateKey
*/
protected $privateKey;
/**
* Constructs a UpdateProcessor.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
* @param \Drupal\Core\Queue\QueueFactory $queue_factory
* The queue factory
* @param \Drupal\update\UpdateFetcherInterface $update_fetcher
* The update fetcher service
* @param \Drupal\Core\State\StateInterface $state_store
* The state service.
* @param \Drupal\Core\PrivateKey $private_key
* The private key factory service.
* @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory
* The key/value factory.
* @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_expirable_factory
* The expirable key/value factory.
*/
public function __construct(ConfigFactoryInterface $config_factory, QueueFactory $queue_factory, UpdateFetcherInterface $update_fetcher, StateInterface $state_store, PrivateKey $private_key, KeyValueFactoryInterface $key_value_factory, KeyValueFactoryInterface $key_value_expirable_factory) {
$this->updateFetcher = $update_fetcher;
$this->updateSettings = $config_factory->get('update.settings');
$this->fetchQueue = $queue_factory->get('update_fetch_tasks');
$this->tempStore = $key_value_expirable_factory->get('update');
$this->fetchTaskStore = $key_value_factory->get('update_fetch_task');
$this->availableReleasesTempStore = $key_value_expirable_factory->get('update_available_releases');
$this->stateStore = $state_store;
$this->privateKey = $private_key;
$this->fetchTasks = [];
$this->failed = [];
}
/**
* {@inheritdoc}
*/
public function createFetchTask($project) {
if (empty($this->fetchTasks)) {
$this->fetchTasks = $this->fetchTaskStore->getAll();
}
if (empty($this->fetchTasks[$project['name']])) {
$this->fetchQueue->createItem($project);
$this->fetchTaskStore->set($project['name'], $project);
$this->fetchTasks[$project['name']] = REQUEST_TIME;
}
}
/**
* {@inheritdoc}
*/
public function fetchData() {
$end = time() + $this->updateSettings->get('fetch.timeout');
if ($this->fetchQueue->numberOfItems()) {
// Delete any stored project data as that needs refreshing when
// update_calculate_project_data() is called.
$this->tempStore->delete('update_project_data');
}
while (time() < $end && ($item = $this->fetchQueue->claimItem())) {
$this->processFetchTask($item->data);
$this->fetchQueue->deleteItem($item);
}
}
/**
* {@inheritdoc}
*/
public function processFetchTask($project) {
global $base_url;
// This can be in the middle of a long-running batch, so REQUEST_TIME won't
// necessarily be valid.
$request_time_difference = time() - REQUEST_TIME;
if (empty($this->failed)) {
// If we have valid data about release history XML servers that we have
// failed to fetch from on previous attempts, load that.
$this->failed = $this->tempStore->get('fetch_failures');
}
$max_fetch_attempts = $this->updateSettings->get('fetch.max_attempts');
$success = FALSE;
$available = [];
$site_key = Crypt::hmacBase64($base_url, $this->privateKey->get());
$fetch_url_base = $this->updateFetcher->getFetchBaseUrl($project);
$project_name = $project['name'];
if (empty($this->failed[$fetch_url_base]) || $this->failed[$fetch_url_base] < $max_fetch_attempts) {
$data = $this->updateFetcher->fetchProjectData($project, $site_key);
}
if (!empty($data)) {
$available = $this->parseXml($data);
// @todo: Purge release data we don't need. See
// https://www.drupal.org/node/238950.
if (!empty($available)) {
// Only if we fetched and parsed something sane do we return success.
$success = TRUE;
}
}
else {
$available['project_status'] = 'not-fetched';
if (empty($this->failed[$fetch_url_base])) {
$this->failed[$fetch_url_base] = 1;
}
else {
$this->failed[$fetch_url_base]++;
}
}
$frequency = $this->updateSettings->get('check.interval_days');
$available['last_fetch'] = REQUEST_TIME + $request_time_difference;
$this->availableReleasesTempStore->setWithExpire($project_name, $available, $request_time_difference + (60 * 60 * 24 * $frequency));
// Stash the $this->failed data back in the DB for the next 5 minutes.
$this->tempStore->setWithExpire('fetch_failures', $this->failed, $request_time_difference + (60 * 5));
// Whether this worked or not, we did just (try to) check for updates.
$this->stateStore->set('update.last_check', REQUEST_TIME + $request_time_difference);
// Now that we processed the fetch task for this project, clear out the
// record for this task so we're willing to fetch again.
$this->fetchTaskStore->delete($project_name);
return $success;
}
/**
* Parses the XML of the Drupal release history info files.
*
* @param string $raw_xml
* A raw XML string of available release data for a given project.
*
* @return array
* Array of parsed data about releases for a given project, or NULL if there
* was an error parsing the string.
*/
protected function parseXml($raw_xml) {
try {
$xml = new \SimpleXMLElement($raw_xml);
}
catch (\Exception $e) {
// SimpleXMLElement::__construct produces an E_WARNING error message for
// each error found in the XML data and throws an exception if errors
// were detected. Catch any exception and return failure (NULL).
return NULL;
}
// If there is no valid project data, the XML is invalid, so return failure.
if (!isset($xml->short_name)) {
return NULL;
}
$data = [];
foreach ($xml as $k => $v) {
$data[$k] = (string) $v;
}
$data['releases'] = [];
if (isset($xml->releases)) {
foreach ($xml->releases->children() as $release) {
$version = (string) $release->version;
$data['releases'][$version] = [];
foreach ($release->children() as $k => $v) {
$data['releases'][$version][$k] = (string) $v;
}
$data['releases'][$version]['terms'] = [];
if ($release->terms) {
foreach ($release->terms->children() as $term) {
if (!isset($data['releases'][$version]['terms'][(string) $term->name])) {
$data['releases'][$version]['terms'][(string) $term->name] = [];
}
$data['releases'][$version]['terms'][(string) $term->name][] = (string) $term->value;
}
}
}
}
return $data;
}
/**
* {@inheritdoc}
*/
public function numberOfQueueItems() {
return $this->fetchQueue->numberOfItems();
}
/**
* {@inheritdoc}
*/
public function claimQueueItem() {
return $this->fetchQueue->claimItem();
}
/**
* {@inheritdoc}
*/
public function deleteQueueItem($item) {
return $this->fetchQueue->deleteItem($item);
}
}
<?php
namespace Drupal\update;
/**
* Processor of project update information.
*/
interface UpdateProcessorInterface {
/**
* Claims an item in the update fetch queue for processing.
*
* @return bool|object
* On success we return an item object. If the queue is unable to claim an
* item it returns false.
*
* @see \Drupal\Core\Queue\QueueInterface::claimItem()
*/
public function claimQueueItem();
/**
* Attempts to drain the queue of tasks for release history data to fetch.
*/
public function fetchData();
/**
* Adds a task to the queue for fetching release history data for a project.
*
* We only create a new fetch task if there's no task already in the queue for
* this particular project (based on 'update_fetch_task' key-value
* collection).
*
* @param array $project
* Associative array of information about a project as created by
* \Drupal\update\UpdateManager::getProjects(), including keys such as
* 'name' (short name), and the 'info' array with data from a .info.yml
* file for the project.
*
* @see \Drupal\update\UpdateManager::getProjects()
* @see update_get_available()
* @see \Drupal\update\UpdateManager::refreshUpdateData()
* @see \Drupal\update\UpdateProcessor::fetchData()
* @see \Drupal\update\UpdateProcessor::processFetchTask()
*/
public function createFetchTask($project);
/**
* Processes a task to fetch available update data for a single project.
*
* Once the release history XML data is downloaded, it is parsed and saved in
* an entry just for that project.
*
* @param array $project
* Associative array of information about the project to fetch data for.
*
* @return bool
* TRUE if we fetched parsable XML, otherwise FALSE.
*/
public function processFetchTask($project);
/**
* Retrieves the number of items in the update fetch queue.
*
* @return int
* An integer estimate of the number of items in the queue.
*
* @see \Drupal\Core\Queue\QueueInterface::numberOfItems()
*/
public function numberOfQueueItems();
/**
* Deletes a finished item from the update fetch queue.
*
* @param object $item
* The item returned by \Drupal\Core\Queue\QueueInterface::claimItem().
*
* @see \Drupal\Core\Queue\QueueInterface::deleteItem()
*/
public function deleteQueueItem($item);
}
<?php
namespace Drupal\update;
use Drupal\Core\DrupalKernelInterface;
use Symfony\Component\HttpFoundation\RequestStack;
/**
* Gets the root path used by the Update Manager to install or update projects.
*/
class UpdateRootFactory {
/**
* The Drupal kernel.
*
* @var \Drupal\Core\DrupalKernelInterface
*/
protected $drupalKernel;
/**
* The request stack.
*
* @var \Symfony\Component\HttpFoundation\RequestStack
*/
protected $requestStack;
/**
* Constructs an UpdateRootFactory instance.
*
* @param \Drupal\Core\DrupalKernelInterface $drupal_kernel
* The Drupal kernel.
* @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
* The request stack.
*/
public function __construct(DrupalKernelInterface $drupal_kernel, RequestStack $request_stack) {
$this->drupalKernel = $drupal_kernel;
$this->requestStack = $request_stack;
}
/**
* Gets the root path under which projects are installed or updated.
*
* The Update Manager will ensure that project files can only be copied to
* specific subdirectories of this root path.
*
* @return string
*/
public function get() {
// Normally the Update Manager's root path is the same as the app root (the
// directory in which the Drupal site is installed).
$root_path = $this->drupalKernel->getAppRoot();
// When running in a test site, change the root path to be the testing site
// directory. This ensures that it will always be writable by the webserver
// (thereby allowing the actual extraction and installation of projects by
// the Update Manager to be tested) and also ensures that new project files
// added there won't be visible to the parent site and will be properly
// cleaned up once the test finishes running. This is done here (rather
// than having the tests enable a module which overrides the update root
// factory service) to ensure that the parent site is automatically kept
// clean without relying on test authors to take any explicit steps. See
// also \Drupal\update\Tests\UpdateTestBase::setUp().
if (DRUPAL_TEST_IN_CHILD_SITE) {
$kernel = $this->drupalKernel;
$request = $this->requestStack->getCurrentRequest();
$root_path .= '/' . $kernel::findSitePath($request);
}
return $root_path;
}
}
<?php
namespace Drupal\update;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Url;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Configure update settings for this site.
*
* @internal
*/
class UpdateSettingsForm extends ConfigFormBase implements ContainerInjectionInterface {
/**
* The email validator.
*
* @var \Drupal\Component\Utility\EmailValidatorInterface
*/
protected $emailValidator;
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
$instance = parent::create($container);
$instance->emailValidator = $container->get('email.validator');
return $instance;
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'update_settings';
}
/**
* {@inheritdoc}
*/
protected function getEditableConfigNames() {
return ['update.settings'];
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this->config('update.settings');
$form['update_check_frequency'] = [
'#type' => 'radios',
'#title' => t('Check for updates'),
'#default_value' => $config->get('check.interval_days'),
'#options' => [
'1' => t('Daily'),
'7' => t('Weekly'),
],
'#description' => t('Select how frequently you want to automatically check for new releases of your currently installed modules and themes.'),
];
$form['update_check_disabled'] = [
'#type' => 'checkbox',
'#title' => t('Check for updates of uninstalled modules and themes'),
'#default_value' => $config->get('check.disabled_extensions'),
];
$notification_emails = $config->get('notification.emails');
$form['update_notify_emails'] = [
'#type' => 'textarea',
'#title' => t('Email addresses to notify when updates are available'),
'#rows' => 4,
'#default_value' => implode("\n", $notification_emails),
'#description' => t('Whenever your site checks for available updates and finds new releases, it can notify a list of users via email. Put each address on a separate line. If blank, no emails will be sent.'),
];
$form['update_notification_threshold'] = [
'#type' => 'radios',
'#title' => t('Email notification threshold'),
'#default_value' => $config->get('notification.threshold'),
'#options' => [
'all' => t('All newer versions'),
'security' => t('Only security updates'),
],
'#description' => t('You can choose to send email only if a security update is available, or to be notified about all newer versions. If there are updates available of Drupal core or any of your installed modules and themes, your site will always print a message on the <a href=":status_report">status report</a> page, and will also display an error message on administration pages if there is a security update.', [':status_report' => Url::fromRoute('system.status')->toString()]),
];
return parent::buildForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
$form_state->set('notify_emails', []);
if (!$form_state->isValueEmpty('update_notify_emails')) {
$valid = [];
$invalid = [];
foreach (explode("\n", trim($form_state->getValue('update_notify_emails'))) as $email) {
$email = trim($email);
if (!empty($email)) {
if ($this->emailValidator->isValid($email)) {
$valid[] = $email;
}
else {
$invalid[] = $email;
}
}
}
if (empty($invalid)) {
$form_state->set('notify_emails', $valid);
}
elseif (count($invalid) == 1) {
$form_state->setErrorByName('update_notify_emails', $this->t('%email is not a valid email address.', ['%email' => reset($invalid)]));
}
else {
$form_state->setErrorByName('update_notify_emails', $this->t('%emails are not valid email addresses.', ['%emails' => implode(', ', $invalid)]));
}
}
parent::validateForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this->config('update.settings');
// See if the update_check_disabled setting is being changed, and if so,
// invalidate all update status data.
if ($form_state->getValue('update_check_disabled') != $config->get('check.disabled_extensions')) {
update_storage_clear();
}
$config
->set('check.disabled_extensions', $form_state->getValue('update_check_disabled'))
->set('check.interval_days', $form_state->getValue('update_check_frequency'))
->set('notification.emails', $form_state->get('notify_emails'))
->set('notification.threshold', $form_state->getValue('update_notification_threshold'))
->save();
parent::submitForm($form, $form_state);
}
}
{#
/**
* @file
* Default theme implementation for the last time update data was checked.
*
* Available variables:
* - last: The timestamp that the site was last checked for updates.
* - time: The formatted time since the site last checked for updates.
* - link: A link to check for updates manually.
*
* @see template_preprocess_update_last_check()
*
* @ingroup themeable
*/
#}
<p>
{% if last %}
{{ 'Last checked: @time ago'|t({'@time': time}) }}
{% else %}
{{ 'Last checked: never'|t }}
{% endif %}
({{ link }})
</p>
{#
/**
* @file
* Default theme implementation for the project status report.
*
* Available variables:
* - title: The project title.
* - url: The project url.
* - status: The project status.
* - label: The project status label.
* - attributes: HTML attributes for the project status.
* - reason: The reason you should update the project.
* - icon: The project status version indicator icon.
* - existing_version: The version of the installed project.
* - versions: The available versions of the project.
* - install_type: The type of project (e.g., dev).
* - datestamp: The date/time of a project version's release.
* - extras: HTML attributes and additional information about the project.
* - attributes: HTML attributes for the extra item.
* - label: The label for an extra item.
* - data: The data about an extra item.
* - includes: The projects within the project.
* - disabled: The currently disabled projects in the project.
*
* @see template_preprocess_update_project_status()
*
* @ingroup themeable
*/
#}
{%
set status_classes = [
project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_SECURE') ? 'project-update__status--security-error',
project.status == constant('Drupal\\update\\UpdateManagerInterface::REVOKED') ? 'project-update__status--revoked',
project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_SUPPORTED') ? 'project-update__status--not-supported',
project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_CURRENT') ? 'project-update__status--not-current',
project.status == constant('Drupal\\update\\UpdateManagerInterface::CURRENT') ? 'project-update__status--current',
]
%}
<div{{ status.attributes.addClass('project-update__status', status_classes) }}>
{%- if status.label -%}
<span>{{ status.label }}</span>
{%- else -%}
{{ status.reason }}
{%- endif %}
<span class="project-update__status-icon">
{{ status.icon }}
</span>
</div>
<div class="project-update__title">
{%- if url -%}
<a href="{{ url }}">{{ title }}</a>
{%- else -%}
{{ title }}
{%- endif %}
{{ existing_version }}
{% if install_type == 'dev' and datestamp %}
<span class="project-update__version-date">({{ datestamp }})</span>
{% endif %}
</div>
{% if versions %}
{% for version in versions %}
{{ version }}
{% endfor %}
{% endif %}
{%
set extra_classes = [
project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_SECURE') ? 'project-not-secure',
project.status == constant('Drupal\\update\\UpdateManagerInterface::REVOKED') ? 'project-revoked',
project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_SUPPORTED') ? 'project-not-supported',
]
%}
<div class="project-updates__details">
{% if extras %}
<div class="extra">
{% for extra in extras %}
<div{{ extra.attributes.addClass(extra_classes) }}>
{{ extra.label }}: {{ extra.data }}
</div>
{% endfor %}
</div>
{% endif %}
{% set includes = includes|join(', ') %}
{% if disabled %}
{{ 'Includes:'|t }}
<ul>
<li>
{% trans %}
Enabled: {{ includes|placeholder }}
{% endtrans %}
</li>
<li>
{% set disabled = disabled|join(', ') %}
{% trans %}
Disabled: {{ disabled|placeholder }}
{% endtrans %}
</li>
</ul>
{% else %}
{% trans %}
Includes: {{ includes|placeholder }}
{% endtrans %}
{% endif %}
</div>
{#
/**
* @file
* Default theme implementation for the project status report.
*
* Available variables:
* - last_checked: Themed last time update data was checked.
* - no_updates_message: Message when there are no project updates.
* - project_types: A list of project types.
* - label: The project type label.
* - table: The project status table.
*
* @see template_preprocess_update_report()
*
* @ingroup themeable
*/
#}
{{ last_checked }}
{% for project_type in project_types %}
<h3>{{ project_type.label }}</h3>
{{ project_type.table }}
{% else %}
<p>{{ no_updates_message }}</p>
{% endfor %}
{#
/**
* @file
* Default theme implementation for the version display of a project.
*
* Available variables:
* - attributes: HTML attributes suitable for a container element.
* - title: The title of the project.
* - core_compatibility_details: Render array of core compatibility details.
* - version: A list of data about the latest released version, containing:
* - version: The version number.
* - date: The date of the release.
* - download_link: The URL for the downloadable file.
* - release_link: The URL for the release notes.
* - core_compatible: A flag indicating whether the project is compatible
* with the currently installed version of Drupal core. This flag is not
* set for the Drupal core project itself.
* - core_compatibility_message: A message indicating the versions of Drupal
* core with which this project is compatible. This message is also
* contained within the 'core_compatibility_details' variable documented
* above. This message is not set for the Drupal core project itself.
*
* @see template_preprocess_update_version()
*
* @ingroup themeable
*/
#}
<div class="{{ attributes.class }} project-update__version"{{ attributes|without('class') }}>
<div class="clearfix">
<div class="project-update__version-title layout-column layout-column--quarter">{{ title }}</div>
<div class="project-update__version-details layout-column layout-column--quarter">
<a href="{{ version.release_link }}">{{ version.version }}</a>
<span class="project-update__version-date">({{ version.date|date('Y-M-d') }})</span>
</div>
<div class="layout-column layout-column--half">
<ul class="project-update__version-links">
{% if version.core_compatible is not defined or version.core_compatible %}
<li class="project-update__download-link">
<a href="{{ version.download_link }}">{{ 'Download'|t }}</a>
</li>
{% endif %}
<li class="project-update__release-notes-link">
<a href="{{ version.release_link }}">{{ 'Release notes'|t }}</a>
</li>
{% if core_compatibility_details %}
<li class="project-update__compatibility-details">
{{ core_compatibility_details }}
</li>
{% endif %}
</ul>
</div>
</div>
</div>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.,8.x-2.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 8.x-2.0</name>
<version>8.x-2.0</version>
<tag>8.x-2.0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-2.0.tar.gz</download_link>
<date>1250422521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0-beta1</name>
<version>8.x-2.0-beta1</version>
<tag>8.x-2.0-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-2.0-beta1.tar.gz</download_link>
<date>1250422521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0-alpha1</name>
<version>8.x-2.0-alpha1</version>
<tag>8.x-2.0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-2.0-alpha1.tar.gz</download_link>
<date>1250422521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>8.x-1.1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1.tar.gz</download_link>
<date>1250404525</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Unsupported</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>8.x-1.0</tag>
<status>unpublished</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.0.tar.gz</download_link>
<date>1250404521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<!--
This XML file is the exact same as the file aaa_update_test.1_0-supported.xml
except 'supported_branches' in this file does not contain the '8.x-1.' branch.
Therefore, all the releases that start with '8.x-1.' are in an unsupported
branch.
-->
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-2.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 8.x-2.0</name>
<version>8.x-2.0</version>
<tag>8.x-2.0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-2.0.tar.gz</download_link>
<date>1250422521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0-beta1</name>
<version>8.x-2.0-beta1</version>
<tag>8.x-2.0-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-2.0-beta1.tar.gz</download_link>
<date>1250422521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0-alpha1</name>
<version>8.x-2.0-alpha1</version>
<tag>8.x-2.0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-2.0-alpha1.tar.gz</download_link>
<date>1250422521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>8.x-1.1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1.tar.gz</download_link>
<date>1250404525</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Unsupported</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>8.x-1.0</tag>
<status>unpublished</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.0.tar.gz</download_link>
<date>1250404521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>aaa_update_test 8.x-3.0</name>
<version>8.x-3.0</version>
<tag>DRUPAL-8--3-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-3.0.tar.gz</download_link>
<date>1250426521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>aaa_update_test 8.x-3.0</name>
<version>8.x-3.0</version>
<tag>DRUPAL-8--3-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-3.0.tar.gz</download_link>
<date>1250426521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-alpha1</name>
<version>8.x-1.1-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-alpha1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.0.tar.gz</download_link>
<date>1073781824</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>aaa_update_test 8.x-3.0</name>
<version>8.x-3.0</version>
<tag>DRUPAL-8--3-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-3.0.tar.gz</download_link>
<date>1250426521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-beta1</name>
<version>8.x-1.1-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-beta1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-alpha1</name>
<version>8.x-1.1-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-alpha1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.0.tar.gz</download_link>
<date>1073781824</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>aaa_update_test 8.x-3.0</name>
<version>8.x-3.0</version>
<tag>DRUPAL-8--3-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-3.0.tar.gz</download_link>
<date>1250426521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-beta1</name>
<version>8.x-1.1-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-beta1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-alpha1</name>
<version>8.x-1.1-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-alpha1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.0.tar.gz</download_link>
<date>1250404521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>aaa_update_test 8.x-3.0</name>
<version>8.x-3.0</version>
<tag>DRUPAL-8--3-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-3.0.tar.gz</download_link>
<date>1250426521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2-alpha1</name>
<version>8.x-1.2-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2-alpha1.tar.gz</download_link>
<date>1250413521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-beta1</name>
<version>8.x-1.1-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-beta1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-alpha1</name>
<version>8.x-1.1-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-alpha1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.0.tar.gz</download_link>
<date>1250404521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>aaa_update_test 8.x-3.0</name>
<version>8.x-3.0</version>
<tag>DRUPAL-8--3-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-3.0.tar.gz</download_link>
<date>1250426521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2-beta1</name>
<version>8.x-1.2-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2-beta1.tar.gz</download_link>
<date>1250412521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2-alpha1</name>
<version>8.x-1.2-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2-alpha1.tar.gz</download_link>
<date>1250413521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-beta1</name>
<version>8.x-1.1-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-beta1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-alpha1</name>
<version>8.x-1.1-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-alpha1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.0.tar.gz</download_link>
<date>1250404521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>aaa_update_test 8.x-3.0</name>
<version>8.x-3.0</version>
<tag>DRUPAL-8--3-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-3.0.tar.gz</download_link>
<date>1250426521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2.tar.gz</download_link>
<date>1250421521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2-beta1</name>
<version>8.x-1.2-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2-beta1.tar.gz</download_link>
<date>1250412521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2-alpha1</name>
<version>8.x-1.2-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2-alpha1.tar.gz</download_link>
<date>1250413521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-beta1</name>
<version>8.x-1.1-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-beta1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-alpha1</name>
<version>8.x-1.1-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-alpha1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.0.tar.gz</download_link>
<date>1250404521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.,8.x-2.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>aaa_update_test 8.x-3.0</name>
<version>8.x-3.0</version>
<tag>DRUPAL-8--3-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-3.0.tar.gz</download_link>
<date>1250426521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0-alpha1</name>
<version>8.x-2.0-alpha1</version>
<tag>DRUPAL-8--2-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-2.0-alpha1.tar.gz</download_link>
<date>1250422521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2.tar.gz</download_link>
<date>1250421521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2-beta1</name>
<version>8.x-1.2-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2-beta1.tar.gz</download_link>
<date>1250412521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2-alpha1</name>
<version>8.x-1.2-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2-alpha1.tar.gz</download_link>
<date>1250413521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-beta1</name>
<version>8.x-1.1-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-beta1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-alpha1</name>
<version>8.x-1.1-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-alpha1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.0.tar.gz</download_link>
<date>1250404521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.,8.x-2.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>aaa_update_test 8.x-3.0</name>
<version>8.x-3.0</version>
<tag>DRUPAL-8--3-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-3.0.tar.gz</download_link>
<date>1250426521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0-beta1</name>
<version>8.x-2.0-beta1</version>
<tag>DRUPAL-8--2-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-2.0-beta1.tar.gz</download_link>
<date>1250442521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0-alpha1</name>
<version>8.x-2.0-alpha1</version>
<tag>DRUPAL-8--2-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-2.0-alpha1.tar.gz</download_link>
<date>1250422521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2.tar.gz</download_link>
<date>1250421521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2-beta1</name>
<version>8.x-1.2-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2-beta1.tar.gz</download_link>
<date>1250412521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2-alpha1</name>
<version>8.x-1.2-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2-alpha1.tar.gz</download_link>
<date>1250413521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-beta1</name>
<version>8.x-1.1-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-beta1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-alpha1</name>
<version>8.x-1.1-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-alpha1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.0.tar.gz</download_link>
<date>1250404521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.,8.x-2.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>aaa_update_test 8.x-3.0</name>
<version>8.x-3.0</version>
<tag>DRUPAL-8--3-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-3.0.tar.gz</download_link>
<date>1250426521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0</name>
<version>8.x-2.0</version>
<tag>DRUPAL-8--2-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-2.0.tar.gz</download_link>
<date>1250422521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0-beta1</name>
<version>8.x-2.0-beta1</version>
<tag>DRUPAL-8--2-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-2.0-beta1.tar.gz</download_link>
<date>1250422521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0-alpha1</name>
<version>8.x-2.0-alpha1</version>
<tag>DRUPAL-8--2-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-2.0-alpha1.tar.gz</download_link>
<date>1250422521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2.tar.gz</download_link>
<date>1250421521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2-beta1</name>
<version>8.x-1.2-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2-beta1.tar.gz</download_link>
<date>1250412521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2-alpha1</name>
<version>8.x-1.2-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.2-alpha1.tar.gz</download_link>
<date>1250413521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-beta1</name>
<version>8.x-1.1-beta1</version>
<tag>DRUPAL-8--1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-beta1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1-alpha1</name>
<version>8.x-1.1-alpha1</version>
<tag>DRUPAL-8--1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-alpha1-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.1-alpha1.tar.gz</download_link>
<date>1250414521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8.x-1.0.tar.gz</download_link>
<date>1250404521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 8.x-1.3-beta1</name>
<version>8.x-1.3-beta1</version>
<tag>DRUPAL-8--1-3-beta1</tag>
<core_compatibility>8.0.0 || 8.1.1</core_compatibility>
<version_major>1</version_major>
<version_patch>3</version_patch>
<version_extra>beta1</version_extra>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-3-beta1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-3-beta1.tar.gz</download_link>
<date>1250624521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073751924</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-2</tag>
<core_compatibility>^8</core_compatibility>
<version_major>1</version_major>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-2.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<version_major>1</version_major>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-1.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<version_major>1</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.,8.x-2.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 8.x-2.2</name>
<version>8.x-2.2</version>
<tag>8.x-2.2</tag>
<core_compatibility>^8.1.1</core_compatibility>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-2.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>8.x-2.2</tag>
<core_compatibility>^8.1.0</core_compatibility>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-2.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>8.x-2.2</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<error>No release history was found for the requested project (aaa_update_test).</error>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-2</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-2.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-2</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-2.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.,8.x-2.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 8.x-3.0-beta2</name>
<version>8.x-3.0-beta2</version>
<tag>8.x-3.0-beta2</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-beta2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-3-0-beta2.tar.gz</download_link>
<date>1533298080</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>aaa_update_test 8.x-3.0-beta1</name>
<version>8.x-3.0-beta1</version>
<tag>8.x-3.0-beta1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-beta1</release_link>
<download_link>http://example.com/aaa_update_test--8-x-3-0-beta1.tar.gz</download_link>
<date>1533270485</date>
<terms>
<term><name>Release type</name><value>Insecure</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>aaa_update_test 8.x-2.2</name>
<version>8.x-2.2</version>
<tag>DRUPAL-8--2-2</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-2.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.1</name>
<version>8.x-2.1</version>
<tag>DRUPAL-8--2-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0</name>
<version>8.x-2.0</version>
<tag>DRUPAL-8--2-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-2</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-2.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.,8.x-2.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 8.x-2.2</name>
<version>8.x-2.2</version>
<tag>DRUPAL-8--2-2</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-2.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.1</name>
<version>8.x-2.1</version>
<tag>DRUPAL-8--2-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0</name>
<version>8.x-2.0</version>
<tag>DRUPAL-8--2-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-2</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-2.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>BBB Update test</title>
<short_name>bbb_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/bbb_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>bbb_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-7--1-0</tag>
<status>published</status>
<release_link>http://example.com/bbb_update_test-7-x-1-0-release</release_link>
<download_link>http://example.com/bbb_update_test-8.x-1.0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<!--
This fixture is used by Drupal\Tests\update\Functional\UpdateManagerUpdateTest.
It contains 2 releases, 8.x-1.0 (which is the currently installed version) and
8.x-1.1, which is the only available update.
To ensure we've got test coverage for the case where the '<core_compatibility>'
tag is not defined at all, this fixture does not include that value.
-->
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>BBB Update test</title>
<short_name>bbb_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/bbb_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>bbb_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>8.x-1.1</tag>
<status>published</status>
<release_link>http://example.com/bbb_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/bbb_update_test-8.x-1.1.tar.gz</download_link>
<date>1250444521</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>bbb_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>8.x-1.0</tag>
<status>published</status>
<release_link>http://example.com/bbb_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/bbb_update_test-8.x-1.0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<!--
This fixture is used by Drupal\Tests\update\Functional\UpdateManagerUpdateTest.
It contains 3 releases:
- 8.x-1.0: The currently installed version in the test scenarios.
- 8.x-1.1: An available update that does not specify '<core_compatibility>'.
- 8.x-1.2: An available update that uses '<core_compatibility>' to require at
least Drupal core version 8.1.0. Since the currently installed Drupal core
for the tests is 8.0.0, this release will be flagged as 'Not compatible'.
-->
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>BBB Update test</title>
<short_name>bbb_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/bbb_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>bbb_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>8.x-1.2</tag>
<core_compatibility>^8.1.0</core_compatibility>
<status>published</status>
<release_link>http://example.com/bbb_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/bbb_update_test-8.x-1.2.tar.gz</download_link>
<date>1250445521</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>bbb_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>8.x-1.1</tag>
<status>published</status>
<release_link>http://example.com/bbb_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/bbb_update_test-8.x-1.1.tar.gz</download_link>
<date>1250444521</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>bbb_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>8.x-1.0</tag>
<status>published</status>
<release_link>http://example.com/bbb_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/bbb_update_test-8.x-1.0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>CCC Update test</title>
<short_name>ccc_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/ccc_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>ccc_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-7--1-0</tag>
<status>published</status>
<release_link>http://example.com/ccc_update_test-7-x-1-0-release</release_link>
<download_link>http://example.com/ccc_update_test-8.x-1.0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250425521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250425521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250425521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250425521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-alpha1</name>
<version>8.0.1-alpha1</version>
<tag>DRUPAL-8-0-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250425521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-beta1</name>
<version>8.0.1-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-alpha1</name>
<version>8.0.1-alpha1</version>
<tag>DRUPAL-8-0-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250425521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-beta1</name>
<version>8.0.1-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-alpha1</name>
<version>8.0.1-alpha1</version>
<tag>DRUPAL-8-0-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250425521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-alpha1</name>
<version>8.1.0-alpha1</version>
<tag>DRUPAL-8-1-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-beta1</name>
<version>8.0.1-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-alpha1</name>
<version>8.0.1-alpha1</version>
<tag>DRUPAL-8-0-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250425521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-beta1</name>
<version>8.1.0-beta1</version>
<tag>DRUPAL-8-1-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-beta1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-alpha1</name>
<version>8.1.0-alpha1</version>
<tag>DRUPAL-8-1-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-beta1</name>
<version>8.0.1-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-alpha1</name>
<version>8.0.1-alpha1</version>
<tag>DRUPAL-8-0-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<!--
This XML file is the exact same as the file drupal.1.xml except
'supported_branches' in this file does not contain the '8.0.' branch. Therefore,
all the releases that start with '8.0.' are in an unsupported branch.
-->
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>8.1.0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-beta1</name>
<version>8.1.0-beta1</version>
<tag>8.1.0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-beta1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-alpha1</name>
<version>8.1.0-alpha1</version>
<tag>8.1.0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.3</name>
<version>8.0.3</version>
<tag>8.0.3</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-3-release</release_link>
<download_link>http://example.com/drupal-8-0-3.tar.gz</download_link>
<date>1250424585</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Unsupported</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>8.0.2</tag>
<status>unpublished</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>8.0.1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-beta1</name>
<version>8.0.1-beta1</version>
<tag>8.0.1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-alpha1</name>
<version>8.0.1-alpha1</version>
<tag>8.0.1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>8.0.0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>8.0.0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>8.0.0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250425521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-beta1</name>
<version>8.1.0-beta1</version>
<tag>DRUPAL-8-1-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-beta1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-alpha1</name>
<version>8.1.0-alpha1</version>
<tag>DRUPAL-8-0-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.3</name>
<version>8.0.3</version>
<tag>8.0.3</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-3-release</release_link>
<download_link>http://example.com/drupal-8-0-3.tar.gz</download_link>
<date>1250424585</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Unsupported</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>8.0.2</tag>
<status>unpublished</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-beta1</name>
<version>8.0.1-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-alpha1</name>
<version>8.0.1-alpha1</version>
<tag>DRUPAL-8-0-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 8.1.1-alpha1</name>
<version>8.1.1-alpha1</version>
<tag>DRUPAL-8-1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-1-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-beta1</name>
<version>8.1.0-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-beta1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-alpha1</name>
<version>8.1.0-alpha1</version>
<tag>DRUPAL-8-1-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-beta1</name>
<version>8.0.1-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-alpha1</name>
<version>8.0.1-alpha1</version>
<tag>DRUPAL-8-0-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250425521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1-alpha1</name>
<version>8.1.1-alpha1</version>
<tag>DRUPAL-8-1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-1-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-beta1</name>
<version>8.1.0-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-beta1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-alpha1</name>
<version>8.1.0-alpha1</version>
<tag>DRUPAL-8-1-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-beta1</name>
<version>8.0.1-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-alpha1</name>
<version>8.0.1-alpha1</version>
<tag>DRUPAL-8-0-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250425521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1-beta1</name>
<version>8.1.1-beta1</version>
<tag>DRUPAL-8-1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-1-1-beta1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1-alpha1</name>
<version>8.1.1-alpha1</version>
<tag>DRUPAL-8-1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-1-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-beta1</name>
<version>8.1.0-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-beta1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-alpha1</name>
<version>8.1.0-alpha1</version>
<tag>DRUPAL-8-1-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-beta1</name>
<version>8.0.1-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-alpha1</name>
<version>8.0.1-alpha1</version>
<tag>DRUPAL-8-0-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 8.1.1</name>
<version>8.1.1</version>
<tag>DRUPAL-8-1-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-release</release_link>
<download_link>http://example.com/drupal-8-1-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1-beta1</name>
<version>8.1.1-beta1</version>
<tag>DRUPAL-8-1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-1-1-beta1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1-alpha1</name>
<version>8.1.1-alpha1</version>
<tag>DRUPAL-8-1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-1-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-beta1</name>
<version>8.1.0-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-beta1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-alpha1</name>
<version>8.1.0-alpha1</version>
<tag>DRUPAL-8-1-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-beta1</name>
<version>8.0.1-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-alpha1</name>
<version>8.0.1-alpha1</version>
<tag>DRUPAL-8-0-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<!-- This release is not in a supported branch; therefore it should not be recommended. -->
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250425521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1</name>
<version>8.1.1</version>
<tag>DRUPAL-8-1-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-release</release_link>
<download_link>http://example.com/drupal-8-1-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1-beta1</name>
<version>8.1.1-beta1</version>
<tag>DRUPAL-8-1-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-1-1-beta1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1-alpha1</name>
<version>8.1.1-alpha1</version>
<tag>DRUPAL-8-1-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-1-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-beta1</name>
<version>8.1.0-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-beta1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0-alpha1</name>
<version>8.1.0-alpha1</version>
<tag>DRUPAL-8-1-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-1-0-alpha1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-beta1</name>
<version>8.0.1-beta1</version>
<tag>DRUPAL-8-0-1-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1-alpha1</name>
<version>8.0.1-alpha1</version>
<tag>DRUPAL-8-0-1-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-1-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-beta1</name>
<version>8.0.0-beta1</version>
<tag>DRUPAL-8-0-0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-beta1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0-alpha1</name>
<version>8.0.0-alpha1</version>
<tag>DRUPAL-8-0-0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-alpha1-release</release_link>
<download_link>http://example.com/drupal-8-0-0-alpha1.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>9.0.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 9.0.0</name>
<version>9.0.0</version>
<tag>DRUPAL-9-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-9-0-0-release</release_link>
<download_link>http://example.com/drupal-9-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.x-dev</name>
<version>8.0.x-dev</version>
<tag>DRUPAL-8-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-x-dev-release</release_link>
<download_link>http://example.com/drupal-8.0.x-dev.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>DRUPAL-8-0-2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.,8.2.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>drupal 8.2.0-rc2</name>
<version>8.2.0-rc2</version>
<tag>8.2.0-rc2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-rc2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-rc2.tar.gz</download_link>
<date>1533298080</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
RC releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-rc1</name>
<version>8.2.0-rc1</version>
<tag>8.2.0-rc1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-rc1-release</release_link>
<download_link>http://example.com/drupal-8-2-0-rc1.tar.gz</download_link>
<date>1533270485</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
RC releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-beta2</name>
<version>8.2.0-beta2</version>
<tag>8.2.0-beta2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-beta2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-beta2.tar.gz</download_link>
<date>1533298080</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-beta1</name>
<version>8.2.0-beta1</version>
<tag>8.2.0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-2-0-beta1.tar.gz</download_link>
<date>1533270485</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-alpha2</name>
<version>8.2.0-alpha2</version>
<tag>8.2.0-alpha2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-alpha2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-alpha2.tar.gz</download_link>
<date>1533298080</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Alpha releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-alpha1</name>
<version>8.2.0-alpha1</version>
<tag>8.2.0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8.2.0-alpha1</release_link>
<download_link>http://example.com/drupal-8-2-0-alpha1.tar.gz</download_link>
<date>1533270485</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Alpha releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>Drupal 8.1.2</name>
<version>8.1.2</version>
<tag>DRUPAL-8-1-2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-2-release</release_link>
<download_link>http://example.com/drupal-8-1-2.tar.gz</download_link>
<date>1250424526</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1</name>
<version>8.1.1</version>
<tag>DRUPAL-8-1-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-release</release_link>
<download_link>http://example.com/drupal-8-1-1.tar.gz</download_link>
<date>1250424525</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424524</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>DRUPAL-8-0-2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424523</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424522</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.,8.2.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>drupal 8.2.0-rc2</name>
<version>8.2.0-rc2</version>
<tag>8.2.0-rc2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-rc2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-rc2.tar.gz</download_link>
<date>1533298080</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
<security>
RC releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-rc1</name>
<version>8.2.0-rc1</version>
<tag>8.2.0-rc1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-rc1-release</release_link>
<download_link>http://example.com/drupal-8-2-0-rc1.tar.gz</download_link>
<date>1533270485</date>
<terms>
<term><name>Release type</name><value>Insecure</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
RC releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-beta2</name>
<version>8.2.0-beta2</version>
<tag>8.2.0-beta2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-beta2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-beta2.tar.gz</download_link>
<date>1533298080</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-beta1</name>
<version>8.2.0-beta1</version>
<tag>8.2.0-beta1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-2-0-beta1.tar.gz</download_link>
<date>1533270485</date>
<terms>
<term><name>Release type</name><value>Insecure</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-alpha2</name>
<version>8.2.0-alpha2</version>
<tag>8.2.0-alpha2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-alpha2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-alpha2.tar.gz</download_link>
<date>1533298080</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
<security>
Alpha releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-alpha1</name>
<version>8.2.0-alpha1</version>
<tag>8.2.0-alpha1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8.2.0-alpha1</release_link>
<download_link>http://example.com/drupal-8-2-0-alpha1.tar.gz</download_link>
<date>1533270485</date>
<terms>
<term><name>Release type</name><value>Insecure</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Alpha releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>Drupal 8.1.2</name>
<version>8.1.2</version>
<tag>DRUPAL-8-1-2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-2-release</release_link>
<download_link>http://example.com/drupal-8-1-2.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1</name>
<version>8.1.1</version>
<tag>DRUPAL-8-1-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-release</release_link>
<download_link>http://example.com/drupal-8-1-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>DRUPAL-8-0-2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>DRUPAL-8-0-2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 8.1.2</name>
<version>8.1.2</version>
<tag>DRUPAL-8-1-2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-2-release</release_link>
<download_link>http://example.com/drupal-8-1-2.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1</name>
<version>8.1.1</version>
<tag>DRUPAL-8-1-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-release</release_link>
<download_link>http://example.com/drupal-8-1-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>DRUPAL-8-0-2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<!--
This XML file is the exact same as the file drupal.sec.1.2_insecure.xml except
'supported_branches' in this file does not contain the '8.0.' branch. Therefore,
all the releases that start with '8.0.' are in an unsupported branch.
-->
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 8.1.2</name>
<version>8.1.2</version>
<tag>8.1.2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-2-release</release_link>
<download_link>http://example.com/drupal-8-1-2.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1</name>
<version>8.1.1</version>
<tag>8.1.1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-release</release_link>
<download_link>http://example.com/drupal-8-1-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>8.1.0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>8.0.2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>8.0.1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>8.0.0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 8.1.2</name>
<version>8.1.2</version>
<tag>DRUPAL-8-1-2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-2-release</release_link>
<download_link>http://example.com/drupal-8-1-2.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1</name>
<version>8.1.1</version>
<tag>DRUPAL-8-1-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-release</release_link>
<download_link>http://example.com/drupal-8-1-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>DRUPAL-8-0-2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<recommended_major>8</recommended_major>
<supported_majors>8</supported_majors>
<default_major>8</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms><term><name>Projects</name><value>Drupal project</value></term></terms>
<releases>
<release>
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>drupal 8.2.0-beta2</name>
<version>8.2.0-beta2</version>
<tag>8.2.0-beta2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-beta2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-beta2.tar.gz</download_link>
<date>1533298080</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<recommended_major>8</recommended_major>
<supported_majors>8</supported_majors>
<default_major>8</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms><term><name>Projects</name><value>Drupal project</value></term></terms>
<releases>
<release>
<name>drupal 8.3.0-rc1</name>
<version>8.3.0-rc1</version>
<tag>8.3.0-rc1</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-3-0-rc1-release</release_link>
<download_link>http://example.com/drupal-8-3-0-rc1.tar.gz</download_link>
<date>1533270485</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
RC releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>drupal 8.2.0-beta2</name>
<version>8.2.0-beta2</version>
<tag>8.2.0-beta2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-beta2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-beta2.tar.gz</download_link>
<date>1533298080</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<recommended_major>8</recommended_major>
<supported_majors>8</supported_majors>
<default_major>8</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms><term><name>Projects</name><value>Drupal project</value></term></terms>
<releases>
<release>
<name>Drupal 9.0.0</name>
<version>9.0.0</version>
<tag>DRUPAL-9-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-9-0-0-release</release_link>
<download_link>http://example.com/drupal-9-0-0.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>Drupal 8.3.0</name>
<version>8.3.0</version>
<tag>DRUPAL-8-3-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-3-0-release</release_link>
<download_link>http://example.com/drupal-8-3-0.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>Drupal 8.2.0</name>
<version>8.2.0</version>
<tag>DRUPAL-8-2-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-release</release_link>
<download_link>http://example.com/drupal-8-2-0.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>drupal 8.2.0-beta2</name>
<version>8.2.0-beta2</version>
<tag>8.2.0-beta2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-beta2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-beta2.tar.gz</download_link>
<date>1533298080</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<recommended_major>8</recommended_major>
<supported_majors>8,9</supported_majors>
<default_major>8</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms><term><name>Projects</name><value>Drupal project</value></term></terms>
<releases>
<release>
<name>Drupal 8.9.0</name>
<version>8.9.0</version>
<tag>DRUPAL-8-9-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-9-0-release</release_link>
<download_link>http://example.com/drupal-8-9-0.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>drupal 8.9.0-beta2</name>
<version>8.9.0-beta2</version>
<tag>8.9.0-beta2</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-9-0-beta2-release</release_link>
<download_link>http://example.com/drupal-8-9-0-beta2.tar.gz</download_link>
<date>1533298080</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>Drupal 8.8.0</name>
<version>8.8.0</version>
<tag>DRUPAL-8-8-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-8-0-release</release_link>
<download_link>http://example.com/drupal-8-8-0.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>9.x</api_version>
<recommended_major>8</recommended_major>
<supported_majors>8,9</supported_majors>
<default_major>9</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms><term><name>Projects</name><value>Drupal project</value></term></terms>
<releases>
<release>
<name>Drupal 9.9.0</name>
<version>9.9.0</version>
<tag>DRUPAL-9-9-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-9-9-0-release</release_link>
<download_link>http://example.com/drupal-9-9-0.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>drupal 9.9.0-beta2</name>
<version>9.9.0-beta2</version>
<tag>9.9.0-beta2</tag>
<status>published</status>
<release_link>http://example.com/drupal-9-9-0-beta2-release</release_link>
<download_link>http://example.com/drupal-9-9-0-beta2.tar.gz</download_link>
<date>1533298080</date>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>Drupal 9.8.0</name>
<version>9.8.0</version>
<tag>DRUPAL-9-8-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-9-8-0-release</release_link>
<download_link>http://example.com/drupal-9-8-0.tar.gz</download_link>
<date>1250424641</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>Drupal 9.1.0</name>
<version>9.1.0</version>
<tag>DRUPAL-9-1-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-9-1-0-release</release_link>
<download_link>http://example.com/drupal-9-1-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
<release>
<name>Drupal 9.0.0</name>
<version>9.0.0</version>
<tag>DRUPAL-9-0-0</tag>
<status>published</status>
<release_link>http://example.com/drupal-9-0-0-release</release_link>
<download_link>http://example.com/drupal-9-0-0.tar.gz</download_link>
<date>1250424521</date>
<terms>
<term>
<name>Release type</name>
<value>New features</value>
</term>
<term>
<name>Release type</name>
<value>Bug fixes</value>
</term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Update test base theme</title>
<short_name>update_test_basetheme</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/update_test_basetheme</link>
<terms>
<term><name>Projects</name><value>Themes</value></term>
</terms>
<releases>
<release>
<name>update_test_basetheme 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-7--1-1</tag>
<status>published</status>
<release_link>http://example.com/update_test_basetheme-7-x-1-1-release</release_link>
<download_link>http://example.com/update_test_basetheme-8.x-1.1.tar.gz</download_link>
<date>1250624521</date>
<terms>
<term><name>Release type</name><value>Security update</value></term>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>update_test_basetheme 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-7--1-0</tag>
<status>published</status>
<release_link>http://example.com/update_test_basetheme-7-x-1-0-release</release_link>
<download_link>http://example.com/update_test_basetheme-8.x-1.0.tar.gz</download_link>
<date>1250524521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Update test new module</title>
<short_name>update_test_new_module</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/update_test_new_module</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>update_test_new_module 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<status>published</status>
<release_link>http://example.com/update_test_new_module-8-x-1-1-release</release_link>
<download_link>core/modules/update/tests/update_test_new_module/8.x-1.1/update_test_new_module.tar.gz</download_link>
<date>1300424521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Update test subtheme</title>
<short_name>update_test_subtheme</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.x-1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/update_test_subtheme</link>
<terms>
<term><name>Projects</name><value>Themes</value></term>
</terms>
<releases>
<release>
<name>update_test_subtheme 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-7--1-0</tag>
<status>published</status>
<release_link>http://example.com/update_test_subtheme-7-x-1-0-release</release_link>
<download_link>http://example.com/update_test_subtheme-8.x-1.0.tar.gz</download_link>
<date>1250524521</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
name: 'AAA Update test'
type: module
description: 'Support module for update module testing.'
package: Testing
core: 8.x
name: 'BBB Update test'
type: module
description: 'Support module for update module testing.'
package: Testing
core: 8.x
name: 'CCC Update test'
type: module
description: 'Support module for update module testing.'
package: Testing
core: 8.x
# Schema for the configuration files of the Update Test module.
update_test.settings:
type: config_object
label: 'Update test settings'
mapping:
system_info:
type: sequence
label: 'System info'
sequence:
type: sequence
label: 'Items'
sequence:
type: string
label: 'Item'
update_status:
type: sequence
label: 'Update status'
sequence:
type: mapping
label: 'Module'
mapping:
status:
type: integer
label: 'Value'
xml_map:
type: sequence
label: 'XML map'
sequence:
type: string
label: 'Value'
<?php
namespace Drupal\update_test\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
/**
* Provides different routes of the update_test module.
*/
class UpdateTestController extends ControllerBase {
/**
* Displays an Error 503 (Service unavailable) page.
*
* @return \Symfony\Component\HttpFoundation\Response
* Returns the response with a special header.
*/
public function updateError() {
$response = new Response();
$response->setStatusCode(503);
$response->headers->set('Status', '503 Service unavailable');
return $response;
}
/**
* Page callback: Prints mock XML for the Update Manager module.
*
* The specific XML file to print depends on two things: the project we're
* trying to fetch data for, and the desired "availability scenario" for that
* project which we're trying to test. Before attempting to fetch this data (by
* checking for updates on the available updates report), callers need to define
* the 'update_test_xml_map' variable as an array, keyed by project name,
* indicating which availability scenario to use for that project.
*
* @param string $project_name
* The project short name the update manager is trying to fetch data for (the
* fetch URLs are of the form: [base_url]/[project_name]/[core_version]).
* @param string $version
* The version of Drupal core.
*
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse|Response
* A BinaryFileResponse object containing the content of the XML release file
* for the specified project if one is available; a Response object with no
* content otherwise.
*/
public function updateTest($project_name, $version) {
$xml_map = $this->config('update_test.settings')->get('xml_map');
if (isset($xml_map[$project_name])) {
$availability_scenario = $xml_map[$project_name];
}
elseif (isset($xml_map['#all'])) {
$availability_scenario = $xml_map['#all'];
}
else {
// The test didn't specify (for example, the webroot has other modules and
// themes installed but they're disabled by the version of the site
// running the test. So, we default to a file we know won't exist, so at
// least we'll get an empty xml response instead of a bunch of Drupal page
// output.
$availability_scenario = '#broken#';
}
$file = __DIR__ . "/../../../../fixtures/release-history/$project_name.$availability_scenario.xml";
$headers = ['Content-Type' => 'text/xml; charset=utf-8'];
if (!is_file($file)) {
// Return an empty response.
return new Response('', 200, $headers);
}
return new BinaryFileResponse($file, 200, $headers);
}
}
<?php
namespace Drupal\update_test\Datetime;
use Drupal\Component\Datetime\Time;
/**
* Test service for altering the request time.
*/
class TestTime extends Time {
/**
* {@inheritdoc}
*/
public function getRequestTime() {
if ($mock_date = \Drupal::state()->get('update_test.mock_date', NULL)) {
return \DateTime::createFromFormat('Y-m-d', $mock_date)->getTimestamp();
}
return parent::getRequestTime();
}
}
<?php
namespace Drupal\update_test\Plugin\Archiver;
use Drupal\Core\Archiver\ArchiverInterface;
/**
* Defines a test archiver implementation.
*
* @Archiver(
* id = "update_test_archiver",
* title = @Translation("Update Test Archiver"),
* extensions = {"update-test-extension"}
* )
*/
class UpdateTestArchiver implements ArchiverInterface {
/**
* {@inheritdoc}
*/
public function add($file_path) {
return $this;
}
/**
* {@inheritdoc}
*/
public function remove($path) {
return $this;
}
/**
* {@inheritdoc}
*/
public function extract($path, array $files = []) {
return $this;
}
/**
* {@inheritdoc}
*/
public function listContents() {
return [];
}
}
<?php
namespace Drupal\update_test;
use Drupal\Core\FileTransfer\Local;
/**
* Provides an object to test the settings form functionality.
*
* This class extends \Drupal\Core\FileTransfer\Local to make module install
* testing via \Drupal\Core\FileTransfer\Form\FileTransferAuthorizeForm and
* authorize.php possible.
*
* @see \Drupal\update\Tests\FileTransferAuthorizeFormTest
*/
class TestFileTransferWithSettingsForm extends Local {
/**
* Returns a Drupal\update_test\TestFileTransferWithSettingsForm object.
*
* @return static
* A new Drupal\update_test\TestFileTransferWithSettingsForm object.
*/
public static function factory($jail, $settings) {
return new static($jail, \Drupal::service('file_system'));
}
/**
* Returns a settings form with a text field to input a username.
*/
public function getSettingsForm() {
$form = [];
$form['update_test_username'] = [
'#type' => 'textfield',
'#title' => t('Update Test Username'),
];
return $form;
}
}
name: 'Update test'
type: module
description: 'Support module for update module testing.'
package: Testing
core: 8.x
<?php
/**
* @file
* Module for testing Update Manager functionality.
*/
use Drupal\Core\Extension\Extension;
/**
* Implements hook_system_info_alter().
*
* Checks the 'update_test.settings:system_info' configuration and sees if we
* need to alter the system info for the given $file based on the setting. The
* setting is expected to be a nested associative array. If the key '#all' is
* defined, its subarray will include .info.yml keys and values for all modules
* and themes on the system. Otherwise, the settings array is keyed by the
* module or theme short name ($file->name) and the subarrays contain settings
* just for that module or theme.
*/
function update_test_system_info_alter(&$info, Extension $file) {
$setting = \Drupal::config('update_test.settings')->get('system_info');
foreach (['#all', $file->getName()] as $id) {
if (!empty($setting[$id])) {
foreach ($setting[$id] as $key => $value) {
$info[$key] = $value;
}
}
}
}
/**
* Implements hook_update_status_alter().
*
* Checks the 'update_test.settings:update_status' configuration and sees if we
* need to alter the update status for the given project based on the setting.
* The setting is expected to be a nested associative array. If the key '#all'
* is defined, its subarray will include .info.yml keys and values for all modules
* and themes on the system. Otherwise, the settings array is keyed by the
* module or theme short name and the subarrays contain settings just for that
* module or theme.
*/
function update_test_update_status_alter(&$projects) {
$setting = \Drupal::config('update_test.settings')->get('update_status');
if (!empty($setting)) {
foreach ($projects as $project_name => &$project) {
foreach (['#all', $project_name] as $id) {
if (!empty($setting[$id])) {
foreach ($setting[$id] as $key => $value) {
$project[$key] = $value;
}
}
}
}
}
}
/**
* Implements hook_filetransfer_info().
*/
function update_test_filetransfer_info() {
// Define a test file transfer method, to ensure that there will always be at
// least one method available in the user interface (regardless of the
// environment in which the update manager tests are run).
return [
'system_test' => [
'title' => t('Update Test FileTransfer'),
'class' => 'Drupal\update_test\TestFileTransferWithSettingsForm',
'weight' => -20,
],
];
}
update_test.503:
path: '/503-error'
defaults:
_controller: '\Drupal\update_test\Controller\UpdateTestController::updateError'
requirements:
_access: 'TRUE'
update_test.update_test:
path: '/update-test/{project_name}/{version}'
defaults:
_title: 'Update test'
_controller: '\Drupal\update_test\Controller\UpdateTestController::updateTest'
version: NULL
project_name: NULL
requirements:
_access: 'TRUE'
services:
datetime.time:
class: Drupal\update_test\Datetime\TestTime
arguments: ['@request_stack']
<?php
namespace Drupal\Tests\update\Functional;
/**
* Tests the Update Manager module upload via authorize.php functionality.
*
* @group update
*/
class FileTransferAuthorizeFormTest extends UpdateTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['update', 'update_test'];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
protected function setUp() {
parent::setUp();
$admin_user = $this->drupalCreateUser([
'administer modules',
'administer software updates',
'administer site configuration',
]);
$this->drupalLogin($admin_user);
// Create a local cache so the module is not downloaded from drupal.org.
$cache_directory = _update_manager_cache_directory(TRUE);
foreach (['.tar.gz', '.zip'] as $extension) {
$filename = 'update_test_new_module' . $extension;
copy(
__DIR__ . '/../../update_test_new_module/8.x-1.0/' . $filename,
$cache_directory . '/' . $filename
);
}
}
/**
* Tests the Update Manager module upload via authorize.php functionality.
*
* @dataProvider archiveFileUrlProvider
*/
public function testViaAuthorize($url) {
// Ensure the that we can select which file transfer backend to use.
\Drupal::state()->set('test_uploaders_via_prompt', TRUE);
// Ensure the module does not already exist.
$this->drupalGet('admin/modules');
$this->assertNoText('Update test new module');
$edit = [
'project_url' => $url,
];
$this->drupalPostForm('admin/modules/install', $edit, t('Install'));
$edit = [
'connection_settings[authorize_filetransfer_default]' => 'system_test',
'connection_settings[system_test][update_test_username]' => $this->randomMachineName(),
];
$this->drupalPostForm(NULL, $edit, t('Continue'));
$this->assertText(t('Installation was completed successfully.'));
// Ensure the module is available to install.
$this->drupalGet('admin/modules');
$this->assertText('Update test new module');
}
/**
* Data provider method for testViaAuthorize().
*
* Each of these release URLs has been cached in the setUp() method.
*/
public function archiveFileUrlProvider() {
return [
'tar.gz' => [
'url' => 'https://ftp.drupal.org/files/projects/update_test_new_module.tar.gz',
],
'zip' => [
'url' => 'https://ftp.drupal.org/files/projects/update_test_new_module.zip',
],
];
}
}
<?php
namespace Drupal\Tests\update\Functional;
use Drupal\Core\Link;
use Drupal\Core\Url;
use Drupal\Core\Utility\ProjectInfo;
use Drupal\update\UpdateManagerInterface;
/**
* Tests how the Update Manager module handles contributed modules and themes in
* a series of functional tests using mock XML data.
*
* @group update
*/
class UpdateContribTest extends UpdateTestBase {
/**
* {@inheritdoc}
*/
protected $updateTableLocator = 'table.update:nth-of-type(2)';
/**
* {@inheritdoc}
*/
protected $updateProject = 'aaa_update_test';
/**
* Modules to enable.
*
* @var array
*/
public static $modules = [
'update_test',
'update',
'aaa_update_test',
'bbb_update_test',
'ccc_update_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
protected function setUp() {
parent::setUp();
$admin_user = $this->drupalCreateUser(['administer site configuration']);
$this->drupalLogin($admin_user);
}
/**
* Tests when there is no available release data for a contrib module.
*/
public function testNoReleasesAvailable() {
$system_info = [
'#all' => [
'version' => '8.0.0',
],
'aaa_update_test' => [
'project' => 'aaa_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(['drupal' => '0.0', 'aaa_update_test' => 'no-releases']);
$this->drupalGet('admin/reports/updates');
// Cannot use $this->standardTests() because we need to check for the
// 'No available releases found' string.
$this->assertRaw('<h3>' . t('Drupal core') . '</h3>');
$this->assertRaw(Link::fromTextAndUrl(t('Drupal'), Url::fromUri('http://example.com/project/drupal'))->toString());
$this->assertText(t('Up to date'));
$this->assertRaw('<h3>' . t('Modules') . '</h3>');
$this->assertNoText(t('Update available'));
$this->assertText(t('No available releases found'));
$this->assertNoRaw(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString());
$available = update_get_available();
$this->assertFalse(isset($available['aaa_update_test']['fetch_status']), 'Results are cached even if no releases are available.');
}
/**
* Tests the basic functionality of a contrib module on the status report.
*/
public function testUpdateContribBasic() {
$project_link = Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString();
$system_info = [
'#all' => [
'version' => '8.0.0',
],
'aaa_update_test' => [
'project' => 'aaa_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(
[
'drupal' => '0.0',
'aaa_update_test' => '1_0',
]
);
$this->standardTests();
$this->assertText(t('Up to date'));
$this->assertRaw('<h3>' . t('Modules') . '</h3>');
$this->assertNoText(t('Update available'));
$this->assertRaw($project_link, 'Link to aaa_update_test project appears.');
// Since aaa_update_test is installed the fact it is hidden and in the
// Testing package means it should not appear.
$system_info['aaa_update_test']['hidden'] = TRUE;
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(
[
'drupal' => '0.0',
'aaa_update_test' => '1_0',
]
);
$this->assertNoRaw($project_link, 'Link to aaa_update_test project does not appear.');
// A hidden and installed project not in the Testing package should appear.
$system_info['aaa_update_test']['package'] = 'aaa_update_test';
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(
[
'drupal' => '0.0',
'aaa_update_test' => '1_0',
]
);
$this->assertRaw($project_link, 'Link to aaa_update_test project appears.');
}
/**
* Tests that contrib projects are ordered by project name.
*
* If a project contains multiple modules, we want to make sure that the
* available updates report is sorted by the parent project names, not by the
* names of the modules included in each project. In this test case, we have
* two contrib projects, "BBB Update test" and "CCC Update test". However, we
* have a module called "aaa_update_test" that's part of the "CCC Update test"
* project. We need to make sure that we see the "BBB" project before the
* "CCC" project, even though "CCC" includes a module that's processed first
* if you sort alphabetically by module name (which is the order we see things
* inside \Drupal\Core\Extension\ExtensionList::getList() for example).
*/
public function testUpdateContribOrder() {
// We want core to be version 8.0.0.
$system_info = [
'#all' => [
'version' => '8.0.0',
],
// All the rest should be visible as contrib modules at version 8.x-1.0.
// aaa_update_test needs to be part of the "CCC Update test" project,
// which would throw off the report if we weren't properly sorting by
// the project names.
'aaa_update_test' => [
'project' => 'ccc_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
// This should be its own project, and listed first on the report.
'bbb_update_test' => [
'project' => 'bbb_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
// This will contain both aaa_update_test and ccc_update_test, and
// should come after the bbb_update_test project.
'ccc_update_test' => [
'project' => 'ccc_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(['drupal' => '0.0', '#all' => '1_0']);
$this->standardTests();
// We're expecting the report to say all projects are up to date.
$this->assertText(t('Up to date'));
$this->assertNoText(t('Update available'));
// We want to see all 3 module names listed, since they'll show up either
// as project names or as modules under the "Includes" listing.
$this->assertText(t('AAA Update test'));
$this->assertText(t('BBB Update test'));
$this->assertText(t('CCC Update test'));
// We want aaa_update_test included in the ccc_update_test project, not as
// its own project on the report.
$this->assertNoRaw(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString(), 'Link to aaa_update_test project does not appear.');
// The other two should be listed as projects.
$this->assertRaw(Link::fromTextAndUrl(t('BBB Update test'), Url::fromUri('http://example.com/project/bbb_update_test'))->toString(), 'Link to bbb_update_test project appears.');
$this->assertRaw(Link::fromTextAndUrl(t('CCC Update test'), Url::fromUri('http://example.com/project/ccc_update_test'))->toString(), 'Link to bbb_update_test project appears.');
// We want to make sure we see the BBB project before the CCC project.
// Instead of just searching for 'BBB Update test' or something, we want
// to use the full markup that starts the project entry itself, so that
// we're really testing that the project listings are in the right order.
$bbb_project_link = '<div class="project-update__title"><a href="http://example.com/project/bbb_update_test">BBB Update test</a>';
$ccc_project_link = '<div class="project-update__title"><a href="http://example.com/project/ccc_update_test">CCC Update test</a>';
$this->assertTrue(strpos($this->getSession()->getPage()->getContent(), $bbb_project_link) < strpos($this->getSession()->getPage()->getContent(), $ccc_project_link), "'BBB Update test' project is listed before the 'CCC Update test' project");
}
/**
* Tests that subthemes are notified about security updates for base themes.
*/
public function testUpdateBaseThemeSecurityUpdate() {
// @todo https://www.drupal.org/node/2338175 base themes have to be
// installed.
// Only install the subtheme, not the base theme.
\Drupal::service('theme_installer')->install(['update_test_subtheme']);
// Define the initial state for core and the subtheme.
$system_info = [
// We want core to be version 8.0.0.
'#all' => [
'version' => '8.0.0',
],
// Show the update_test_basetheme
'update_test_basetheme' => [
'project' => 'update_test_basetheme',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
// Show the update_test_subtheme
'update_test_subtheme' => [
'project' => 'update_test_subtheme',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$xml_mapping = [
'drupal' => '0.0',
'update_test_subtheme' => '1_0',
'update_test_basetheme' => '1_1-sec',
];
$this->refreshUpdateStatus($xml_mapping);
$this->assertText(t('Security update required!'));
$this->assertRaw(Link::fromTextAndUrl(t('Update test base theme'), Url::fromUri('http://example.com/project/update_test_basetheme'))->toString(), 'Link to the Update test base theme project appears.');
}
/**
* Tests the Update Manager module when one normal update is available.
*/
public function testNormalUpdateAvailable() {
$assert_session = $this->assertSession();
// Ensure that the update check requires a token.
$this->drupalGet('admin/reports/updates/check');
$assert_session->statusCodeEquals(403);
$system_info = [
'aaa_update_test' => [
'project' => 'aaa_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
foreach (['1.1', '1.2', '2.0'] as $version) {
foreach (['-beta1', '-alpha1', ''] as $extra_version) {
$full_version = "8.x-$version$extra_version";
$this->refreshUpdateStatus([
'drupal' => '0.0',
'aaa_update_test' => str_replace('.', '_', $version) . $extra_version,
]);
$this->standardTests();
$this->drupalGet('admin/reports/updates');
$this->clickLink('Check manually');
$this->checkForMetaRefresh();
$assert_session->pageTextNotContains('Security update required!');
// The XML test fixtures for this method all contain the '8.x-3.0'
// release but because '8.x-3.0' is not in a supported branch it will
// not be in the available updates.
$this->assertNoRaw('8.x-3.0');
// Set a CSS selector in order for assertions to target the 'Modules'
// table and not Drupal core updates.
$this->updateTableLocator = 'table.update:nth-of-type(2)';
switch ($version) {
case '1.1':
// Both stable and unstable releases are available.
// A stable release is the latest.
if ($extra_version == '') {
$assert_session->elementTextNotContains('css', $this->updateTableLocator, 'Up to date');
$assert_session->elementTextContains('css', $this->updateTableLocator, 'Update available');
$this->assertVersionUpdateLinks('Recommended version', $full_version);
$assert_session->elementTextNotContains('css', $this->updateTableLocator, 'Latest version:');
$assert_session->elementContains('css', $this->updateTableLocator, 'warning.svg');
}
// Only unstable releases are available.
// An unstable release is the latest.
else {
$assert_session->elementTextContains('css', $this->updateTableLocator, 'Up to date');
$assert_session->elementTextNotContains('css', $this->updateTableLocator, 'Update available');
$assert_session->elementTextNotContains('css', $this->updateTableLocator, 'Recommended version:');
$this->assertVersionUpdateLinks('Latest version', $full_version);
$assert_session->elementContains('css', $this->updateTableLocator, 'check.svg');
}
break;
case '1.2':
// Both stable and unstable releases are available.
// A stable release is the latest.
if ($extra_version == '') {
$assert_session->elementTextNotContains('css', $this->updateTableLocator, 'Up to date');
$assert_session->elementTextContains('css', $this->updateTableLocator, 'Update available');
$this->assertVersionUpdateLinks('Recommended version:', $full_version);
$assert_session->elementTextNotContains('css', $this->updateTableLocator, 'Latest version:');
$assert_session->elementContains('css', $this->updateTableLocator, 'warning.svg');
}
// Both stable and unstable releases are available.
// An unstable release is the latest.
else {
$assert_session->elementTextNotContains('css', $this->updateTableLocator, 'Up to date');
$assert_session->elementTextContains('css', $this->updateTableLocator, 'Update available');
$this->assertVersionUpdateLinks('Recommended version:', '8.x-1.1');
$this->assertVersionUpdateLinks('Latest version:', $full_version);
$assert_session->elementTextContains('css', $this->updateTableLocator, 'Latest version:');
$assert_session->elementContains('css', $this->updateTableLocator, 'warning.svg');
}
break;
case '2.0':
// When next major release (either stable or unstable) is available
// and the current major is still supported, the next major will be
// listed as "Also available".
$assert_session->elementTextNotContains('css', $this->updateTableLocator, 'Up to date');
$assert_session->elementTextContains('css', $this->updateTableLocator, 'Update available');
$this->assertVersionUpdateLinks('Recommended version', '8.x-1.2');
$this->assertVersionUpdateLinks('Also available', $full_version);
$assert_session->elementTextNotContains('css', $this->updateTableLocator, 'Latest version:');
$assert_session->elementContains('css', $this->updateTableLocator, 'warning.svg');
}
}
}
}
/**
* Tests that disabled themes are only shown when desired.
*
* @todo https://www.drupal.org/node/2338175 extensions can not be hidden and
* base themes have to be installed.
*/
public function testUpdateShowDisabledThemes() {
$update_settings = $this->config('update.settings');
// Make sure all the update_test_* themes are disabled.
$extension_config = $this->config('core.extension');
foreach ($extension_config->get('theme') as $theme => $weight) {
if (preg_match('/^update_test_/', $theme)) {
$extension_config->clear("theme.$theme");
}
}
$extension_config->save();
// Define the initial state for core and the test contrib themes.
$system_info = [
// We want core to be version 8.0.0.
'#all' => [
'version' => '8.0.0',
],
// The update_test_basetheme should be visible and up to date.
'update_test_basetheme' => [
'project' => 'update_test_basetheme',
'version' => '8.x-1.1',
'hidden' => FALSE,
],
// The update_test_subtheme should be visible and up to date.
'update_test_subtheme' => [
'project' => 'update_test_subtheme',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
];
// When there are contributed modules in the site's file system, the
// total number of attempts made in the test may exceed the default value
// of update_max_fetch_attempts. Therefore this variable is set very high
// to avoid test failures in those cases.
$update_settings->set('fetch.max_attempts', 99999)->save();
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$xml_mapping = [
'drupal' => '0.0',
'update_test_subtheme' => '1_0',
'update_test_basetheme' => '1_1-sec',
];
$base_theme_project_link = Link::fromTextAndUrl(t('Update test base theme'), Url::fromUri('http://example.com/project/update_test_basetheme'))->toString();
$sub_theme_project_link = Link::fromTextAndUrl(t('Update test subtheme'), Url::fromUri('http://example.com/project/update_test_subtheme'))->toString();
foreach ([TRUE, FALSE] as $check_disabled) {
$update_settings->set('check.disabled_extensions', $check_disabled)->save();
$this->refreshUpdateStatus($xml_mapping);
// In neither case should we see the "Themes" heading for installed
// themes.
$this->assertNoText(t('Themes'));
if ($check_disabled) {
$this->assertText(t('Uninstalled themes'));
$this->assertRaw($base_theme_project_link, 'Link to the Update test base theme project appears.');
$this->assertRaw($sub_theme_project_link, 'Link to the Update test subtheme project appears.');
}
else {
$this->assertNoText(t('Uninstalled themes'));
$this->assertNoRaw($base_theme_project_link, 'Link to the Update test base theme project does not appear.');
$this->assertNoRaw($sub_theme_project_link, 'Link to the Update test subtheme project does not appear.');
}
}
}
/**
* Tests updates with a hidden base theme.
*/
public function testUpdateHiddenBaseTheme() {
module_load_include('compare.inc', 'update');
// Install the subtheme.
\Drupal::service('theme_installer')->install(['update_test_subtheme']);
// Add a project and initial state for base theme and subtheme.
$system_info = [
// Hide the update_test_basetheme.
'update_test_basetheme' => [
'project' => 'update_test_basetheme',
'hidden' => TRUE,
],
// Show the update_test_subtheme.
'update_test_subtheme' => [
'project' => 'update_test_subtheme',
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$projects = \Drupal::service('update.manager')->getProjects();
$theme_data = \Drupal::service('theme_handler')->rebuildThemeData();
$project_info = new ProjectInfo();
$project_info->processInfoList($projects, $theme_data, 'theme', TRUE);
$this->assertTrue(!empty($projects['update_test_basetheme']), 'Valid base theme (update_test_basetheme) was found.');
}
/**
* Makes sure that if we fetch from a broken URL, sane things happen.
*/
public function testUpdateBrokenFetchURL() {
$system_info = [
'#all' => [
'version' => '8.0.0',
],
'aaa_update_test' => [
'project' => 'aaa_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
'bbb_update_test' => [
'project' => 'bbb_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
'ccc_update_test' => [
'project' => 'ccc_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
// Ensure that the update information is correct before testing.
$this->drupalGet('admin/reports/updates');
$xml_mapping = [
'drupal' => '0.0',
'aaa_update_test' => '1_0',
'bbb_update_test' => 'does-not-exist',
'ccc_update_test' => '1_0',
];
$this->refreshUpdateStatus($xml_mapping);
$this->assertText(t('Up to date'));
// We're expecting the report to say most projects are up to date, so we
// hope that 'Up to date' is not unique.
$this->assertNoUniqueText(t('Up to date'));
// It should say we failed to get data, not that we're missing an update.
$this->assertNoText(t('Update available'));
// We need to check that this string is found as part of a project row, not
// just in the "Failed to get available update data" message at the top of
// the page.
$this->assertRaw('<div class="project-update__status">' . t('Failed to get available update data'));
// We should see the output messages from fetching manually.
$this->assertUniqueText(t('Checked available update data for 3 projects.'));
$this->assertUniqueText(t('Failed to get available update data for one project.'));
// The other two should be listed as projects.
$this->assertRaw(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString(), 'Link to aaa_update_test project appears.');
$this->assertNoRaw(Link::fromTextAndUrl(t('BBB Update test'), Url::fromUri('http://example.com/project/bbb_update_test'))->toString(), 'Link to bbb_update_test project does not appear.');
$this->assertRaw(Link::fromTextAndUrl(t('CCC Update test'), Url::fromUri('http://example.com/project/ccc_update_test'))->toString(), 'Link to bbb_update_test project appears.');
}
/**
* Checks that hook_update_status_alter() works to change a status.
*
* We provide the same external data as if aaa_update_test 8.x-1.0 were
* installed and that was the latest release. Then we use
* hook_update_status_alter() to try to mark this as missing a security
* update, then assert if we see the appropriate warnings on the right pages.
*/
public function testHookUpdateStatusAlter() {
$update_test_config = $this->config('update_test.settings');
$update_admin_user = $this->drupalCreateUser([
'administer site configuration',
'administer software updates',
]);
$this->drupalLogin($update_admin_user);
$system_info = [
'#all' => [
'version' => '8.0.0',
],
'aaa_update_test' => [
'project' => 'aaa_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
];
$update_test_config->set('system_info', $system_info)->save();
$update_status = [
'aaa_update_test' => [
'status' => UpdateManagerInterface::NOT_SECURE,
],
];
$update_test_config->set('update_status', $update_status)->save();
$this->refreshUpdateStatus(
[
'drupal' => '0.0',
'aaa_update_test' => '1_0',
]
);
$this->drupalGet('admin/reports/updates');
$this->assertRaw('<h3>' . t('Modules') . '</h3>');
$this->assertText(t('Security update required!'));
$this->assertRaw(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString(), 'Link to aaa_update_test project appears.');
// Visit the reports page again without the altering and make sure the
// status is back to normal.
$update_test_config->set('update_status', [])->save();
$this->drupalGet('admin/reports/updates');
$this->assertRaw('<h3>' . t('Modules') . '</h3>');
$this->assertNoText(t('Security update required!'));
$this->assertRaw(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString(), 'Link to aaa_update_test project appears.');
// Turn the altering back on and visit the Update manager UI.
$update_test_config->set('update_status', $update_status)->save();
$this->drupalGet('admin/modules/update');
$this->assertText(t('Security update'));
// Turn the altering back off and visit the Update manager UI.
$update_test_config->set('update_status', [])->save();
$this->drupalGet('admin/modules/update');
$this->assertNoText(t('Security update'));
}
/**
* Tests that core compatibility messages are displayed.
*/
public function testCoreCompatibilityMessage() {
$system_info = [
'#all' => [
'version' => '8.0.0',
],
'aaa_update_test' => [
'project' => 'aaa_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
// Confirm that messages are displayed for recommended and latest updates.
// @todo In https://www.drupal.org/project/drupal/issues/3112962:
// Change the calls to 'refreshUpdateStatus()' to use:
// - '1.1' instead of '1.1-core_compatibility'.
// - '1.1-alpha1' instead of '1.1-alpha1-core_compatibility'.
// Delete the files:
// - core/modules/update/tests/modules/update_test/drupal.1.1-alpha1-core_compatibility.xml
// - core/modules/update/tests/modules/update_test/drupal.1.1-core_compatibility.xml
$this->refreshUpdateStatus(['drupal' => '1.1-core_compatibility', 'aaa_update_test' => '8.x-1.2']);
$this->assertCoreCompatibilityMessage('8.x-1.2', '8.0.0 to 8.1.1', 'Recommended version:');
$this->assertCoreCompatibilityMessage('8.x-1.3-beta1', '8.0.0, 8.1.1', 'Latest version:');
// Change the available core releases and confirm that the messages change.
$this->refreshUpdateStatus(['drupal' => '1.1-alpha1-core_compatibility', 'aaa_update_test' => '8.x-1.2']);
$this->assertCoreCompatibilityMessage('8.x-1.2', '8.0.0 to 8.1.0', 'Recommended version:');
$this->assertCoreCompatibilityMessage('8.x-1.3-beta1', '8.0.0', 'Latest version:');
// Confirm that messages are displayed for security and 'Also available'
// updates.
$this->refreshUpdateStatus(['drupal' => '1.1-core_compatibility', 'aaa_update_test' => 'core_compatibility.8.x-1.2_8.x-2.2']);
$this->assertCoreCompatibilityMessage('8.x-1.2', '8.1.0 to 8.1.1', 'Security update:', FALSE);
$this->assertCoreCompatibilityMessage('8.x-2.2', '8.1.1', 'Also available:', FALSE);
}
/**
* Tests update status of security releases.
*
* @param string $module_version
* The module version the site is using.
* @param string[] $expected_security_releases
* The security releases, if any, that the status report should recommend.
* @param string $expected_update_message_type
* The type of update message expected.
* @param string $fixture
* The fixture file to use.
*
* @dataProvider securityUpdateAvailabilityProvider
*/
public function testSecurityUpdateAvailability($module_version, array $expected_security_releases, $expected_update_message_type, $fixture) {
$system_info = [
'#all' => [
'version' => '8.0.0',
],
'aaa_update_test' => [
'project' => 'aaa_update_test',
'version' => $module_version,
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(['drupal' => '0.0', 'aaa_update_test' => $fixture]);
$this->assertSecurityUpdates('aaa_update_test', $expected_security_releases, $expected_update_message_type, 'table.update:nth-of-type(2)');
}
/**
* Data provider method for testSecurityUpdateAvailability().
*
* These test cases rely on the following fixtures containing the following
* releases:
* - aaa_update_test.sec.8.x-1.2.xml
* - 8.x-1.2 Security update
* - 8.x-1.1 Insecure
* - 8.x-1.0 Insecure
* - aaa_update_test.sec.8.x-1.1_8.x-1.2.xml
* - 8.x-1.2 Security update
* - 8.x-1.1 Security update, Insecure
* - 8.x-1.0 Insecure
* - aaa_update_test.sec.8.x-1.2_8.x-2.2.xml
* - 8.x-3.0-beta2
* - 8.x-3.0-beta1 Insecure
* - 8.x-2.2 Security update
* - 8.x-2.1 Security update, Insecure
* - 8.x-2.0 Insecure
* - 8.x-1.2 Security update
* - 8.x-1.1 Insecure
* - 8.x-1.0 Insecure
* - aaa_update_test.sec.8.x-2.2_1.x_secure.xml
* - 8.x-2.2 Security update
* - 8.x-2.1 Security update, Insecure
* - 8.x-2.0 Insecure
* - 8.x-1.2
* - 8.x-1.1
* - 8.x-1.0
*/
public function securityUpdateAvailabilityProvider() {
return [
// Security releases available for module major release 1.
// No releases for next major.
'8.x-1.0, 8.x-1.2' => [
'module_patch_version' => '8.x-1.0',
'expected_security_releases' => ['8.x-1.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.8.x-1.2',
],
// Two security releases available for module major release 1.
// 8.x-1.1 security release marked as insecure.
// No releases for next major.
'8.x-1.0, 8.x-1.1 8.x-1.2' => [
'module_patch_version' => '8.x-1.0',
'expected_security_releases' => ['8.x-1.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.8.x-1.1_8.x-1.2',
],
// Security release available for module major release 2.
// No releases for next major.
'8.x-2.0, 8.x-2.2' => [
'module_patch_version' => '8.x-2.0',
'expected_security_releases' => ['8.x-2.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.8.x-2.2_1.x_secure',
],
'8.x-2.2, 8.x-1.2 8.x-2.2' => [
'module_patch_version' => '8.x-2.2',
'expected_security_releases' => [],
'expected_update_message_type' => static::UPDATE_NONE,
'fixture' => 'sec.8.x-1.2_8.x-2.2',
],
// Security release available for module major release 1.
// Security release also available for next major.
'8.x-1.0, 8.x-1.2 8.x-2.2' => [
'module_patch_version' => '8.x-1.0',
'expected_security_releases' => ['8.x-1.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.8.x-1.2_8.x-2.2',
],
// No security release available for module major release 1 but 1.x
// releases are not marked as insecure.
// Security release available for next major.
'8.x-1.0, 8.x-2.2, not insecure' => [
'module_patch_version' => '8.x-1.0',
'expected_security_releases' => [],
'expected_update_message_type' => static::UPDATE_AVAILABLE,
'fixture' => 'sec.8.x-2.2_1.x_secure',
],
// On latest security release for module major release 1.
// Security release also available for next major.
'8.x-1.2, 8.x-1.2 8.x-2.2' => [
'module_patch_version' => '8.x-1.2',
'expected_security_release' => [],
'expected_update_message_type' => static::UPDATE_NONE,
'fixture' => 'sec.8.x-1.2_8.x-2.2',
],
'8.x-2.0, 8.x-1.2 8.x-2.2' => [
'module_patch_version' => '8.x-2.0',
'expected_security_releases' => ['8.x-2.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.8.x-1.2_8.x-2.2',
],
// @todo In https://www.drupal.org/node/2865920 add test cases:
// - 8.x-3.0-beta1 using fixture 'sec.8.x-1.2_8.x-2.2' to ensure that
// 8.x-2.2 is the only security update.
];
}
/**
* Tests messages when a project release is unpublished.
*
* This test confirms that revoked messages are displayed regardless of
* whether the installed version is in a supported branch or not. This test
* relies on 2 test XML fixtures that are identical except for the
* 'supported_branches' value:
* - aaa_update_test.1_0-supported.xml
* 'supported_branches' is '8.x-1.,8.x-2.'.
* - aaa_update_test.1_0-unsupported.xml
* 'supported_branches' is '8.x-2.'.
* They both have an '8.x-1.0' release that is unpublished and an '8.x-2.0'
* release that is published and is the expected update.
*/
public function testRevokedRelease() {
$system_info = [
'aaa_update_test' => [
'project' => 'aaa_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus([
'drupal' => '0.0',
$this->updateProject => '1_0-supported',
]);
// @todo Change the version label to 'Recommended version:' in
// https://www.drupal.org/node/3114408.
$this->confirmRevokedStatus('8.x-1.0', '8.x-2.0', 'Also available:');
$this->refreshUpdateStatus([
'drupal' => '0.0',
$this->updateProject => '1_0-unsupported',
]);
$this->confirmRevokedStatus('8.x-1.0', '8.x-2.0', 'Recommended version:');
}
/**
* Tests messages when a project release is marked unsupported.
*
* This test confirms unsupported messages are displayed regardless of whether
* the installed version is in a supported branch or not. This test relies on
* 2 test XML fixtures that are identical except for the 'supported_branches'
* value:
* - aaa_update_test.1_0-supported.xml
* 'supported_branches' is '8.x-1.,8.x-2.'.
* - aaa_update_test.1_0-unsupported.xml
* 'supported_branches' is '8.x-2.'.
* They both have an '8.x-1.1' release that has the 'Release type' value of
* 'unsupported' and an '8.x-2.0' release that has the 'Release type' value of
* 'supported' and is the expected update.
*/
public function testUnsupportedRelease() {
$system_info = [
'aaa_update_test' => [
'project' => 'aaa_update_test',
'version' => '8.x-1.1',
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus([
'drupal' => '0.0',
$this->updateProject => '1_0-supported',
]);
// @todo Change the version label to 'Recommended version:' in
// https://www.drupal.org/node/3114408.
$this->confirmUnsupportedStatus('8.x-1.1', '8.x-2.0', 'Also available:');
$this->refreshUpdateStatus([
'drupal' => '0.0',
$this->updateProject => '1_0-unsupported',
]);
$this->confirmUnsupportedStatus('8.x-1.1', '8.x-2.0', 'Recommended version:');
}
/**
* Tests messages for invalid, empty and missing version strings.
*/
public function testNonStandardVersionStrings() {
$version_infos = [
'invalid' => [
'version' => 'llama',
'expected' => 'Invalid version: llama',
],
'empty' => [
'version' => '',
'expected' => 'Empty version',
],
'null' => [
'expected' => 'Invalid version: Unknown',
],
];
foreach ($version_infos as $version_info) {
$system_info = [
'aaa_update_test' => [
'project' => 'aaa_update_test',
'hidden' => FALSE,
],
];
if (isset($version_info['version'])) {
$system_info['aaa_update_test']['version'] = $version_info['version'];
}
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus([
'drupal' => '0.0',
$this->updateProject => '1_0-supported',
]);
$this->standardTests();
$this->assertSession()->elementTextContains('css', $this->updateTableLocator, $version_info['expected']);
}
}
/**
* Asserts that a core compatibility message is correct for an update.
*
* @param string $version
* The version of the update.
* @param string $expected_range
* The expected core compatibility range.
* @param string $expected_release_title
* The expected release title.
* @param bool $is_compatible
* If the update is compatible with the installed version of Drupal.
*/
protected function assertCoreCompatibilityMessage($version, $expected_range, $expected_release_title, $is_compatible = TRUE) {
$update_element = $this->findUpdateElementByLabel($expected_release_title);
$this->assertTrue($update_element->hasLink($version));
$compatibility_details = $update_element->find('css', '.project-update__compatibility-details details');
$this->assertStringContainsString("Requires Drupal core: $expected_range", $compatibility_details->getText());
$details_summary_element = $compatibility_details->find('css', 'summary');
if ($is_compatible) {
$download_version = str_replace('.', '-', $version);
// If an update is compatible with the installed version of Drupal core,
// it should have a download link and the details element should be closed
// by default.
$this->assertFalse($compatibility_details->hasAttribute('open'));
$this->assertSame('Compatible', $details_summary_element->getText());
$this->assertEquals(
$update_element->findLink('Download')->getAttribute('href'),
"http://example.com/{$this->updateProject}-$download_version.tar.gz"
);
}
else {
// If an update is not compatible with the installed version of Drupal
// core, it should not have a download link and the details element should
// be open by default.
$this->assertTrue($compatibility_details->hasAttribute('open'));
$this->assertSame('Not compatible', $details_summary_element->getText());
$this->assertFalse($update_element->hasLink('Download'));
}
}
}
<?php
namespace Drupal\Tests\update\Functional;
use Drupal\Core\Link;
use Drupal\Core\Url;
use Drupal\Tests\Traits\Core\CronRunTrait;
/**
* Tests the Update Manager module through a series of functional tests using
* mock XML data.
*
* @group update
*/
class UpdateCoreTest extends UpdateTestBase {
use CronRunTrait;
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['update_test', 'update', 'language', 'block'];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected $updateTableLocator = 'table.update';
/**
* {@inheritdoc}
*/
protected $updateProject = 'drupal';
protected function setUp() {
parent::setUp();
$admin_user = $this->drupalCreateUser([
'administer site configuration',
'administer modules',
'administer themes',
]);
$this->drupalLogin($admin_user);
$this->drupalPlaceBlock('local_actions_block');
}
/**
* Sets the version to x.x.x when no project-specific mapping is defined.
*
* @param string $version
* The version.
*/
protected function setSystemInfo($version) {
$setting = [
'#all' => [
'version' => $version,
],
];
$this->config('update_test.settings')->set('system_info', $setting)->save();
}
/**
* Tests the Update Manager module when no updates are available.
*
* The XML fixture file 'drupal.1.0.xml' which is one of the XML files this
* test uses also contains 2 extra releases that are newer than '8.0.1'. These
* releases will not show as available updates because of the following
* reasons:
* - '8.0.2' is an unpublished release.
* - '8.0.3' is marked as 'Release type' 'Unsupported'.
*/
public function testNoUpdatesAvailable() {
foreach ([0, 1] as $minor_version) {
foreach ([0, 1] as $patch_version) {
foreach (['-alpha1', '-beta1', ''] as $extra_version) {
$this->setSystemInfo("8.$minor_version.$patch_version" . $extra_version);
$this->refreshUpdateStatus(['drupal' => "$minor_version.$patch_version" . $extra_version]);
$this->standardTests();
// The XML test fixtures for this method all contain the '8.2.0'
// release but because '8.2.0' is not in a supported branch it will
// not be in the available updates.
$this->assertNoRaw('8.2.0');
$this->assertText(t('Up to date'));
$this->assertNoText(t('Update available'));
$this->assertNoText(t('Security update required!'));
$this->assertRaw('check.svg', 'Check icon was found.');
}
}
}
}
/**
* Tests the Update Manager module when one normal update is available.
*/
public function testNormalUpdateAvailable() {
$this->setSystemInfo('8.0.0');
// Ensure that the update check requires a token.
$this->drupalGet('admin/reports/updates/check');
$this->assertSession()->statusCodeEquals(403);
foreach ([0, 1] as $minor_version) {
foreach (['-alpha1', '-beta1', ''] as $extra_version) {
$full_version = "8.$minor_version.1$extra_version";
$this->refreshUpdateStatus(['drupal' => "$minor_version.1" . $extra_version]);
$this->standardTests();
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertNoText(t('Security update required!'));
// The XML test fixtures for this method all contain the '8.2.0' release
// but because '8.2.0' is not in a supported branch it will not be in
// the available updates.
$this->assertNoRaw('8.2.0');
switch ($minor_version) {
case 0:
// Both stable and unstable releases are available.
// A stable release is the latest.
if ($extra_version == '') {
$this->assertNoText(t('Up to date'));
$this->assertText(t('Update available'));
$this->assertVersionUpdateLinks('Recommended version:', $full_version);
$this->assertNoText(t('Latest version:'));
$this->assertRaw('warning.svg', 'Warning icon was found.');
}
// Only unstable releases are available.
// An unstable release is the latest.
else {
$this->assertText(t('Up to date'));
$this->assertNoText(t('Update available'));
$this->assertNoText(t('Recommended version:'));
$this->assertVersionUpdateLinks('Latest version:', $full_version);
$this->assertRaw('check.svg', 'Check icon was found.');
}
break;
case 1:
// Both stable and unstable releases are available.
// A stable release is the latest.
if ($extra_version == '') {
$this->assertNoText(t('Up to date'));
$this->assertText(t('Update available'));
$this->assertVersionUpdateLinks('Recommended version:', $full_version);
$this->assertNoText(t('Latest version:'));
$this->assertRaw('warning.svg', 'Warning icon was found.');
}
// Both stable and unstable releases are available.
// An unstable release is the latest.
else {
$this->assertNoText(t('Up to date'));
$this->assertText(t('Update available'));
$this->assertVersionUpdateLinks('Recommended version:', '8.1.0');
$this->assertVersionUpdateLinks('Latest version:', $full_version);
$this->assertRaw('warning.svg', 'Warning icon was found.');
}
break;
}
}
}
}
/**
* Tests the Update Manager module when a major update is available.
*/
public function testMajorUpdateAvailable() {
foreach ([0, 1] as $minor_version) {
foreach ([0, 1] as $patch_version) {
foreach (['-alpha1', '-beta1', ''] as $extra_version) {
$this->setSystemInfo("8.$minor_version.$patch_version" . $extra_version);
$this->refreshUpdateStatus(['drupal' => '9']);
$this->standardTests();
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertNoText(t('Security update required!'));
$this->assertRaw(Link::fromTextAndUrl('9.0.0', Url::fromUri("http://example.com/drupal-9-0-0-release"))->toString(), 'Link to release appears.');
$this->assertRaw(Link::fromTextAndUrl(t('Download'), Url::fromUri("http://example.com/drupal-9-0-0.tar.gz"))->toString(), 'Link to download appears.');
$this->assertRaw(Link::fromTextAndUrl(t('Release notes'), Url::fromUri("http://example.com/drupal-9-0-0-release"))->toString(), 'Link to release notes appears.');
$this->assertNoText(t('Up to date'));
$this->assertText(t('Not supported!'));
$this->assertText(t('Recommended version:'));
$this->assertNoText(t('Latest version:'));
$this->assertRaw('error.svg', 'Error icon was found.');
}
}
}
}
/**
* Tests the Update Manager module when a security update is available.
*
* @param string $site_patch_version
* The patch version to set the site to for testing.
* @param string[] $expected_security_releases
* The security releases, if any, that the status report should recommend.
* @param string $expected_update_message_type
* The type of update message expected.
* @param string $fixture
* The test fixture that contains the test XML.
*
* @dataProvider securityUpdateAvailabilityProvider
*/
public function testSecurityUpdateAvailability($site_patch_version, array $expected_security_releases, $expected_update_message_type, $fixture) {
$this->setSystemInfo("8.$site_patch_version");
$this->refreshUpdateStatus(['drupal' => $fixture]);
$this->assertSecurityUpdates('drupal-8', $expected_security_releases, $expected_update_message_type, 'table.update');
}
/**
* Data provider method for testSecurityUpdateAvailability().
*
* These test cases rely on the following fixtures containing the following
* releases:
* - drupal.sec.0.1_0.2.xml
* - 8.0.2 Security update
* - 8.0.1 Security update, Insecure
* - 8.0.0 Insecure
* - drupal.sec.0.2.xml
* - 8.0.2 Security update
* - 8.0.1 Insecure
* - 8.0.0 Insecure
* - drupal.sec.0.2-rc2.xml
* - 8.2.0-rc2 Security update
* - 8.2.0-rc1 Insecure
* - 8.2.0-beta2 Insecure
* - 8.2.0-beta1 Insecure
* - 8.2.0-alpha2 Insecure
* - 8.2.0-alpha1 Insecure
* - 8.1.2 Security update
* - 8.1.1 Insecure
* - 8.1.0 Insecure
* - 8.0.2 Security update
* - 8.0.1 Insecure
* - 8.0.0 Insecure
* - drupal.sec.1.2.xml
* - 8.1.2 Security update
* - 8.1.1 Insecure
* - 8.1.0 Insecure
* - 8.0.2
* - 8.0.1
* - 8.0.0
* - drupal.sec.1.2_insecure.xml
* - 8.1.2 Security update
* - 8.1.1 Insecure
* - 8.1.0 Insecure
* - 8.0.2 Insecure
* - 8.0.1 Insecure
* - 8.0.0 Insecure
* - drupal.sec.1.2_insecure-unsupported
* This file has the exact releases as drupal.sec.1.2_insecure.xml. It has a
* different value for 'supported_branches' that does not contain '8.0.'.
* It is used to ensure that the "Security update required!" is displayed
* even if the currently installed version is in an unsupported branch.
* - drupal.sec.0.2-rc2-b.xml
* - 8.2.0-rc2
* - 8.2.0-rc1
* - 8.2.0-beta2
* - 8.2.0-beta1
* - 8.2.0-alpha2
* - 8.2.0-alpha1
* - 8.1.2 Security update
* - 8.1.1 Insecure
* - 8.1.0 Insecure
* - 8.0.2 Security update
* - 8.0.1 Insecure
* - 8.0.0 Insecure
*/
public function securityUpdateAvailabilityProvider() {
$test_cases = [
// Security release available for site minor release 0.
// No releases for next minor.
'0.0, 0.2' => [
'site_patch_version' => '0.0',
'expected_security_releases' => ['0.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.0.2',
],
// Site on latest security release available for site minor release 0.
// Minor release 1 also has a security release, and the current release
// is marked as insecure.
'0.2, 0.2' => [
'site_patch_version' => '0.2',
'expected_security_release' => ['1.2', '2.0-rc2'],
'expected_update_message_type' => static::UPDATE_AVAILABLE,
'fixture' => 'sec.0.2-rc2',
],
// Two security releases available for site minor release 0.
// 0.1 security release marked as insecure.
// No releases for next minor.
'0.0, 0.1 0.2' => [
'site_patch_version' => '0.0',
'expected_security_releases' => ['0.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.0.1_0.2',
],
// Security release available for site minor release 1.
// No releases for next minor.
'1.0, 1.2' => [
'site_patch_version' => '1.0',
'expected_security_releases' => ['1.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.1.2',
],
// Security release available for site minor release 0.
// Security release also available for next minor.
'0.0, 0.2 1.2' => [
'site_patch_version' => '0.0',
'expected_security_releases' => ['0.2', '1.2', '2.0-rc2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.0.2-rc2',
],
// No newer security release for site minor 1.
// Previous minor has security release.
'1.2, 0.2 1.2' => [
'site_patch_version' => '1.2',
'expected_security_releases' => [],
'expected_update_message_type' => static::UPDATE_NONE,
'fixture' => 'sec.0.2-rc2',
],
// No security release available for site minor release 0.
// Security release available for next minor.
'0.0, 1.2, insecure' => [
'site_patch_version' => '0.0',
'expected_security_releases' => ['1.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.1.2_insecure',
],
// No security release available for site minor release 0.
// Site minor is not a supported branch.
// Security release available for next minor.
'0.0, 1.2, insecure-unsupported' => [
'site_patch_version' => '0.0',
'expected_security_releases' => ['1.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.1.2_insecure-unsupported',
],
// All releases for minor 0 are secure.
// Security release available for next minor.
'0.0, 1.2, secure' => [
'site_patch_version' => '0.0',
'expected_security_release' => ['1.2'],
'expected_update_message_type' => static::UPDATE_AVAILABLE,
'fixture' => 'sec.1.2',
],
'0.2, 1.2, secure' => [
'site_patch_version' => '0.2',
'expected_security_release' => ['1.2'],
'expected_update_message_type' => static::UPDATE_AVAILABLE,
'fixture' => 'sec.1.2',
],
// Site on 2.0-rc2 which is a security release.
'2.0-rc2, 0.2 1.2' => [
'site_patch_version' => '2.0-rc2',
'expected_security_releases' => [],
'expected_update_message_type' => static::UPDATE_NONE,
'fixture' => 'sec.0.2-rc2',
],
// Ensure that 8.0.2 security release is not shown because it is earlier
// version than 1.0.
'1.0, 0.2 1.2' => [
'site_patch_version' => '1.0',
'expected_security_releases' => ['1.2', '2.0-rc2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.0.2-rc2',
],
];
$pre_releases = [
'2.0-alpha1',
'2.0-alpha2',
'2.0-beta1',
'2.0-beta2',
'2.0-rc1',
'2.0-rc2',
];
foreach ($pre_releases as $pre_release) {
// If the site is on an alpha/beta/RC of an upcoming minor and none of the
// alpha/beta/RC versions are marked insecure, no security update should
// be required.
$test_cases["Pre-release:$pre_release, no security update"] = [
'site_patch_version' => $pre_release,
'expected_security_releases' => [],
'expected_update_message_type' => $pre_release === '2.0-rc2' ? static::UPDATE_NONE : static::UPDATE_AVAILABLE,
'fixture' => 'sec.0.2-rc2-b',
];
// If the site is on an alpha/beta/RC of an upcoming minor and there is
// an RC version with a security update, it should be recommended.
$test_cases["Pre-release:$pre_release, security update"] = [
'site_patch_version' => $pre_release,
'expected_security_releases' => $pre_release === '2.0-rc2' ? [] : ['2.0-rc2'],
'expected_update_message_type' => $pre_release === '2.0-rc2' ? static::UPDATE_NONE : static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.0.2-rc2',
];
}
return $test_cases;
}
/**
* Tests the security coverage messages for Drupal core versions.
*
* @param string $installed_version
* The installed Drupal version to test.
* @param string $fixture
* The test fixture that contains the test XML.
* @param string $requirements_section_heading
* The requirements section heading.
* @param string $message
* The expected coverage message.
* @param string $mock_date
* The mock date to use if needed in the format CCYY-MM-DD. If an empty
* string is provided, no mock date will be used.
*
* @dataProvider securityCoverageMessageProvider
*/
public function testSecurityCoverageMessage($installed_version, $fixture, $requirements_section_heading, $message, $mock_date) {
\Drupal::state()->set('update_test.mock_date', $mock_date);
$this->setSystemInfo($installed_version);
$this->refreshUpdateStatus(['drupal' => $fixture]);
$this->drupalGet('admin/reports/status');
if (empty($requirements_section_heading)) {
$this->assertSession()->pageTextNotContains('Drupal core security coverage');
return;
}
$all_requirements_details = $this->getSession()->getPage()->findAll(
'css',
'details.system-status-report__entry:contains("Drupal core security coverage")'
);
// Ensure we only have 1 security message section.
$this->assertCount(1, $all_requirements_details);
$requirements_details = $all_requirements_details[0];
// Ensure that messages are under the correct heading which could be
// 'Checked', 'Warnings found', or 'Errors found'.
$requirements_section_element = $requirements_details->getParent();
$this->assertCount(1, $requirements_section_element->findAll('css', "h3:contains('$requirements_section_heading')"));
$actual_message = $requirements_details->find('css', 'div.system-status-report__entry__value')->getText();
$this->assertNotEmpty($actual_message);
$this->assertEquals($message, $actual_message);
}
/**
* Dataprovider for testSecurityCoverageMessage().
*
* These test cases rely on the following fixtures containing the following
* releases:
* - drupal.sec.2.0_3.0-rc1.xml
* - 8.2.0
* - 8.3.0-rc1
* - drupal.sec.2.0.xml
* - 8.2.0
* - drupal.sec.2.0_9.0.0.xml
* - 8.2.0
* - 9.0.0
* - drupal.sec.9.0.xml
* - 8.9.0
* - drupal.sec.9.9.0.xml
* - 9.9.0
*/
public function securityCoverageMessageProvider() {
$release_coverage_message = 'Visit the release cycle overview for more information on supported releases.';
$coverage_ended_message = 'Coverage has ended';
$update_asap_message = 'Update to a supported minor as soon as possible to continue receiving security updates.';
$update_soon_message = 'Update to a supported minor version soon to continue receiving security updates.';
$test_cases = [
'8.0.0, unsupported' => [
'installed_version' => '8.0.0',
'fixture' => 'sec.2.0_3.0-rc1',
'requirements_section_heading' => 'Errors found',
'message' => "$coverage_ended_message $update_asap_message $release_coverage_message",
'mock_date' => '',
],
'8.1.0, supported with 3rc' => [
'installed_version' => '8.1.0',
'fixture' => 'sec.2.0_3.0-rc1',
'requirements_section_heading' => 'Warnings found',
'message' => "Covered until 8.3.0 Update to 8.2 or higher soon to continue receiving security updates. $release_coverage_message",
'mock_date' => '',
],
'8.1.0, supported' => [
'installed_version' => '8.1.0',
'fixture' => 'sec.2.0',
'requirements_section_heading' => 'Warnings found',
'message' => "Covered until 8.3.0 Update to 8.2 or higher soon to continue receiving security updates. $release_coverage_message",
'mock_date' => '',
],
'8.2.0, supported with 3rc' => [
'installed_version' => '8.2.0',
'fixture' => 'sec.2.0_3.0-rc1',
'requirements_section_heading' => 'Checked',
'message' => "Covered until 8.4.0 $release_coverage_message",
'mock_date' => '',
],
'8.2.0, supported' => [
'installed_version' => '8.2.0',
'fixture' => 'sec.2.0',
'requirements_section_heading' => 'Checked',
'message' => "Covered until 8.4.0 $release_coverage_message",
'mock_date' => '',
],
// Ensure we don't show messages for pre-release or dev versions.
'8.2.0-beta2, no message' => [
'installed_version' => '8.2.0-beta2',
'fixture' => 'sec.2.0_3.0-rc1',
'requirements_section_heading' => '',
'message' => '',
'mock_date' => '',
],
'8.1.0-dev, no message' => [
'installed_version' => '8.1.0-dev',
'fixture' => 'sec.2.0_3.0-rc1',
'requirements_section_heading' => '',
'message' => '',
'mock_date' => '',
],
// Ensures the message is correct if the next major version has been
// released and the additional minors indicated by
// CORE_MINORS_WITH_SECURITY_COVERAGE minors have been released.
'8.0.0, 9 unsupported' => [
'installed_version' => '8.0.0',
'fixture' => 'sec.2.0_9.0.0',
'requirements_section_heading' => 'Errors found',
'message' => "$coverage_ended_message $update_asap_message $release_coverage_message",
'mock_date' => '',
],
// Ensures the message is correct if the next major version has been
// released and the additional minors indicated by
// CORE_MINORS_WITH_SECURITY_COVERAGE minors have not been released.
'8.2.0, 9 warning' => [
'installed_version' => '8.2.0',
'fixture' => 'sec.2.0_9.0.0',
'requirements_section_heading' => 'Warnings found',
'message' => "Covered until 8.4.0 Update to 8.3 or higher soon to continue receiving security updates. $release_coverage_message",
'mock_date' => '',
],
];
// Drupal 8.8.x test cases.
$test_cases += [
// Ensure that a message is displayed during 8.8's active support.
'8.8.0, supported' => [
'installed_version' => '8.8.0',
'fixture' => 'sec.9.0',
'requirements_section_heading' => 'Checked',
'message' => "Covered until 2020-Dec-02 $release_coverage_message",
'mock_date' => '2020-06-01',
],
// Ensure a warning is displayed if less than six months remain until the
// end of 8.8's security coverage.
'8.8.0, supported, 6 months warn' => [
'installed_version' => '8.8.0',
'fixture' => 'sec.9.0',
'requirements_section_heading' => 'Warnings found',
'message' => "Covered until 2020-Dec-02 $update_soon_message $release_coverage_message",
'mock_date' => '2020-06-02',
],
];
// Ensure that the message does not change, including on the last day of
// security coverage.
$test_cases['8.8.0, supported, last day warn'] = $test_cases['8.8.0, supported, 6 months warn'];
$test_cases['8.8.0, supported, last day warn']['mock_date'] = '2020-12-01';
// Ensure that if the 8.8 support window is finished a message is
// displayed.
$test_cases['8.8.0, support over'] = [
'installed_version' => '8.8.0',
'fixture' => 'sec.9.0',
'requirements_section_heading' => 'Errors found',
'message' => "$coverage_ended_message $update_asap_message $release_coverage_message",
'mock_date' => '2020-12-02',
];
// Drupal 8.9 LTS test cases.
$test_cases['8.9.0, lts supported'] = [
'installed_version' => '8.9.0',
'fixture' => 'sec.9.0',
'requirements_section_heading' => 'Checked',
'message' => "Covered until 2021-Nov $release_coverage_message",
'mock_date' => '2021-01-01',
];
// Ensure that the message does not change, including on the last day of
// security coverage.
$test_cases['8.9.0, lts supported, last day'] = $test_cases['8.9.0, lts supported'];
$test_cases['8.9.0, lts supported, last day']['mock_date'] = '2021-10-31';
// Ensure that if LTS support window is finished a message is displayed.
$test_cases['8.9.0, lts support over'] = [
'installed_version' => '8.9.0',
'fixture' => 'sec.9.0',
'requirements_section_heading' => 'Errors found',
'message' => "$coverage_ended_message $update_asap_message $release_coverage_message",
'mock_date' => '2021-11-01',
];
// Drupal 9 test cases.
$test_cases += [
// Ensure the end dates for 8.8 and 8.9 only apply to major version 8.
'9.9.0' => [
'installed_version' => '9.9.0',
'fixture' => 'sec.9.9.0',
'requirements_section_heading' => 'Checked',
'message' => "Covered until 9.11.0 $release_coverage_message",
'mock_date' => '',
],
'9.8.0' => [
'installed_version' => '9.8.0',
'fixture' => 'sec.9.9.0',
'requirements_section_heading' => 'Warnings found',
'message' => "Covered until 9.10.0 Update to 9.9 or higher soon to continue receiving security updates. $release_coverage_message",
'mock_date' => '',
],
];
return $test_cases;
}
/**
* Ensures proper results where there are date mismatches among modules.
*/
public function testDatestampMismatch() {
$system_info = [
'#all' => [
// We need to think we're running a -dev snapshot to see dates.
'version' => '8.1.0-dev',
'datestamp' => time(),
],
'block' => [
// This is 2001-09-09 01:46:40 GMT, so test for "2001-Sep-".
'datestamp' => '1000000000',
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(['drupal' => 'dev']);
$this->assertNoText(t('2001-Sep-'));
$this->assertText(t('Up to date'));
$this->assertNoText(t('Update available'));
$this->assertNoText(t('Security update required!'));
}
/**
* Checks that running cron updates the list of available updates.
*/
public function testModulePageRunCron() {
$this->setSystemInfo('8.0.0');
$this->config('update.settings')
->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
->save();
$this->config('update_test.settings')
->set('xml_map', ['drupal' => '0.0'])
->save();
$this->cronRun();
$this->drupalGet('admin/modules');
$this->assertNoText(t('No update information available.'));
}
/**
* Checks that clearing the disk cache works.
*/
public function testClearDiskCache() {
$directories = [
_update_manager_cache_directory(FALSE),
_update_manager_extract_directory(FALSE),
];
// Check that update directories does not exists.
foreach ($directories as $directory) {
$this->assertDirectoryNotExists($directory);
}
// Method must not fail if update directories do not exists.
update_clear_update_disk_cache();
}
/**
* Checks the messages at admin/modules when the site is up to date.
*/
public function testModulePageUpToDate() {
$this->setSystemInfo('8.0.0');
// Instead of using refreshUpdateStatus(), set these manually.
$this->config('update.settings')
->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
->save();
$this->config('update_test.settings')
->set('xml_map', ['drupal' => '0.0'])
->save();
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertText(t('Checked available update data for one project.'));
$this->drupalGet('admin/modules');
$this->assertNoText(t('There are updates available for your version of Drupal.'));
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
}
/**
* Checks the messages at admin/modules when an update is missing.
*/
public function testModulePageRegularUpdate() {
$this->setSystemInfo('8.0.0');
// Instead of using refreshUpdateStatus(), set these manually.
$this->config('update.settings')
->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
->save();
$this->config('update_test.settings')
->set('xml_map', ['drupal' => '0.1'])
->save();
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertText(t('Checked available update data for one project.'));
$this->drupalGet('admin/modules');
$this->assertText(t('There are updates available for your version of Drupal.'));
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
}
/**
* Checks the messages at admin/modules when a security update is missing.
*/
public function testModulePageSecurityUpdate() {
$this->setSystemInfo('8.0.0');
// Instead of using refreshUpdateStatus(), set these manually.
$this->config('update.settings')
->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
->save();
$this->config('update_test.settings')
->set('xml_map', ['drupal' => 'sec.0.2'])
->save();
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertText(t('Checked available update data for one project.'));
$this->drupalGet('admin/modules');
$this->assertNoText(t('There are updates available for your version of Drupal.'));
$this->assertText(t('There is a security update available for your version of Drupal.'));
// Make sure admin/appearance warns you you're missing a security update.
$this->drupalGet('admin/appearance');
$this->assertNoText(t('There are updates available for your version of Drupal.'));
$this->assertText(t('There is a security update available for your version of Drupal.'));
// Make sure duplicate messages don't appear on Update status pages.
$this->drupalGet('admin/reports/status');
// We're expecting "There is a security update..." inside the status report
// itself, but the message from
// \Drupal\Core\Messenger\MessengerInterface::addStatus() appears as an li
// so we can prefix with that and search for the raw HTML.
$this->assertNoRaw('<li>' . t('There is a security update available for your version of Drupal.'));
$this->drupalGet('admin/reports/updates');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->drupalGet('admin/reports/updates/settings');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
}
/**
* Tests the Update Manager module when the update server returns 503 errors.
*/
public function testServiceUnavailable() {
$this->refreshUpdateStatus([], '503-error');
// Ensure that no "Warning: SimpleXMLElement..." parse errors are found.
$this->assertNoText('SimpleXMLElement');
$this->assertUniqueText(t('Failed to get available update data for one project.'));
}
/**
* Tests that exactly one fetch task per project is created and not more.
*/
public function testFetchTasks() {
$projecta = [
'name' => 'aaa_update_test',
];
$projectb = [
'name' => 'bbb_update_test',
];
$queue = \Drupal::queue('update_fetch_tasks');
$this->assertEqual($queue->numberOfItems(), 0, 'Queue is empty');
update_create_fetch_task($projecta);
$this->assertEqual($queue->numberOfItems(), 1, 'Queue contains one item');
update_create_fetch_task($projectb);
$this->assertEqual($queue->numberOfItems(), 2, 'Queue contains two items');
// Try to add project a again.
update_create_fetch_task($projecta);
$this->assertEqual($queue->numberOfItems(), 2, 'Queue still contains two items');
// Clear storage and try again.
update_storage_clear();
update_create_fetch_task($projecta);
$this->assertEqual($queue->numberOfItems(), 2, 'Queue contains two items');
}
/**
* Checks language module in core package at admin/reports/updates.
*/
public function testLanguageModuleUpdate() {
$this->setSystemInfo('8.0.0');
// Instead of using refreshUpdateStatus(), set these manually.
$this->config('update.settings')
->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
->save();
$this->config('update_test.settings')
->set('xml_map', ['drupal' => '0.1'])
->save();
$this->drupalGet('admin/reports/updates');
$this->assertText(t('Language'));
}
/**
* Ensures that the local actions appear.
*/
public function testLocalActions() {
$admin_user = $this->drupalCreateUser([
'administer site configuration',
'administer modules',
'administer software updates',
'administer themes',
]);
$this->drupalLogin($admin_user);
$this->drupalGet('admin/modules');
$this->clickLink(t('Install new module'));
$this->assertUrl('admin/modules/install');
$this->drupalGet('admin/appearance');
$this->clickLink(t('Install new theme'));
$this->assertUrl('admin/theme/install');
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Install new module or theme'));
$this->assertUrl('admin/reports/updates/install');
}
/**
* Tests messages when a project release is unpublished.
*
* This test confirms that revoked messages are displayed regardless of
* whether the installed version is in a supported branch or not. This test
* relies on 2 test XML fixtures that are identical except for the
* 'supported_branches' value:
* - drupal.1.0.xml
* 'supported_branches' is '8.0.,8.1.'.
* - drupal.1.0-unsupported.xml
* 'supported_branches' is '8.1.'.
* They both have an '8.0.2' release that is unpublished and an '8.1.0'
* release that is published and is the expected update.
*/
public function testRevokedRelease() {
foreach (['1.0', '1.0-unsupported'] as $fixture) {
$this->setSystemInfo('8.0.2');
$this->refreshUpdateStatus([$this->updateProject => $fixture]);
$this->standardTests();
$this->confirmRevokedStatus('8.0.2', '8.1.0', 'Recommended version:');
}
}
/**
* Checks that Drupal recovers after problems connecting to update server.
*/
public function testBrokenThenFixedUpdates() {
$this->drupalLogin($this->drupalCreateUser([
'administer site configuration',
'access administration pages',
]));
$this->setSystemInfo('8.0.0');
// Instead of using refreshUpdateStatus(), set these manually.
$this->config('update.settings')
->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
->save();
// Use update XML that has no information to simulate a broken response from
// the update server.
$this->config('update_test.settings')
->set('xml_map', ['drupal' => 'broken'])
->save();
// This will retrieve broken updates.
$this->cronRun();
$this->drupalGet('admin/reports/status');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('There was a problem checking available updates for Drupal.');
$this->config('update_test.settings')
->set('xml_map', ['drupal' => 'sec.0.2'])
->save();
// Simulate the update_available_releases state expiring before cron is run
// and the state is used by \Drupal\update\UpdateManager::getProjects().
\Drupal::keyValueExpirable('update_available_releases')->deleteAll();
// This cron run should retrieve fixed updates.
$this->cronRun();
$this->drupalGet('admin/structure');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('There is a security update available for your version of Drupal.');
}
/**
* Tests messages when a project release is marked unsupported.
*
* This test confirms unsupported messages are displayed regardless of whether
* the installed version is in a supported branch or not. This test relies on
* 2 test XML fixtures that are identical except for the 'supported_branches'
* value:
* - drupal.1.0.xml
* 'supported_branches' is '8.0.,8.1.'.
* - drupal.1.0-unsupported.xml
* 'supported_branches' is '8.1.'.
* They both have an '8.0.3' release that has the 'Release type' value of
* 'unsupported' and an '8.1.0' release that has the 'Release type' value of
* 'supported' and is the expected update.
*/
public function testUnsupportedRelease() {
foreach (['1.0', '1.0-unsupported'] as $fixture) {
$this->setSystemInfo('8.0.3');
$this->refreshUpdateStatus([$this->updateProject => $fixture]);
$this->standardTests();
$this->confirmUnsupportedStatus('8.0.3', '8.1.0', 'Recommended version:');
}
}
/**
* {@inheritdoc}
*/
protected function assertVersionUpdateLinks($label, $version, $download_version = NULL) {
// Test XML files for Drupal core use '-' in the version number for the
// download link.
$download_version = str_replace('.', '-', $version);
parent::assertVersionUpdateLinks($label, $version, $download_version);
}
}
<?php
namespace Drupal\Tests\update\Functional;
/**
* Tests the Update Manager module's 'Update' form and functionality.
*
* @todo In https://www.drupal.org/project/drupal/issues/3117229 expand this.
*
* @group update
*/
class UpdateManagerUpdateTest extends UpdateTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'update',
'update_test',
'aaa_update_test',
'bbb_update_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$admin_user = $this->drupalCreateUser([
'administer software updates',
'administer site configuration',
]);
$this->drupalLogin($admin_user);
// The installed state of the system is the same for all test cases. What
// varies for each test scenario is which release history fixture we fetch,
// which in turn changes the expected state of the UpdateManagerUpdateForm.
$system_info = [
'#all' => [
'version' => '8.0.0',
],
'aaa_update_test' => [
'project' => 'aaa_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
'bbb_update_test' => [
'project' => 'bbb_update_test',
'version' => '8.x-1.0',
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
}
/**
* Provides data for test scenarios involving incompatible updates.
*
* These test cases rely on the following fixtures containing the following
* releases:
* - aaa_update_test.8.x-1.2.xml
* - 8.x-1.2 Compatible with 8.0.0 core.
* - aaa_update_test.core_compatibility.8.x-1.2_8.x-2.2.xml
* - 8.x-1.2 Requires 8.1.0 and above.
* - bbb_update_test.1_0.xml
* - 8.x-1.0 is the only available release.
* - bbb_update_test.1_1.xml
* - 8.x-1.1 is available and compatible with everything (does not define
* <core_compatibility> at all).
* - bbb_update_test.1_2.xml
* - 8.x-1.1 is available and compatible with everything (does not define
* <core_compatibility> at all).
* - 8.x-1.2 is available and requires Drupal 8.1.0 and above.
*
* @todo In https://www.drupal.org/project/drupal/issues/3112962:
* Change the 'core_fixture' values here to use:
* - '1.1' instead of '1.1-core_compatibility'.
* - '1.1-alpha1' instead of '1.1-alpha1-core_compatibility'.
* Delete the files:
* - core/modules/update/tests/modules/update_test/drupal.1.1-alpha1-core_compatibility.xml
* - core/modules/update/tests/modules/update_test/drupal.1.1-core_compatibility.xml
*
* @return array[]
* Test data.
*/
public function incompatibleUpdatesTableProvider() {
return [
'only one compatible' => [
'core_fixture' => '1.1-core_compatibility',
// aaa_update_test.8.x-1.2.xml has core compatibility set and will test
// the case where $recommended_release['core_compatible'] === TRUE in
// \Drupal\update\Form\UpdateManagerUpdate.
'a_fixture' => '8.x-1.2',
// Use a fixture with only a 8.x-1.0 release so BBB is up to date.
'b_fixture' => '1_0',
'compatible' => [
'AAA' => '8.x-1.2',
],
'incompatible' => [],
],
'only one incompatible' => [
'core_fixture' => '1.1-core_compatibility',
'a_fixture' => 'core_compatibility.8.x-1.2_8.x-2.2',
// Use a fixture with only a 8.x-1.0 release so BBB is up to date.
'b_fixture' => '1_0',
'compatible' => [],
'incompatible' => [
'AAA' => [
'recommended' => '8.x-1.2',
'range' => '8.1.0 to 8.1.1',
],
],
],
'two compatible, no incompatible' => [
'core_fixture' => '1.1-core_compatibility',
'a_fixture' => '8.x-1.2',
// bbb_update_test.1_1.xml does not have core compatibility set and will
// test the case where $recommended_release['core_compatible'] === NULL
// in \Drupal\update\Form\UpdateManagerUpdate.
'b_fixture' => '1_1',
'compatible' => [
'AAA' => '8.x-1.2',
'BBB' => '8.x-1.1',
],
'incompatible' => [],
],
'two incompatible, no compatible' => [
'core_fixture' => '1.1-core_compatibility',
'a_fixture' => 'core_compatibility.8.x-1.2_8.x-2.2',
// bbb_update_test.1_2.xml has core compatibility set and will test the
// case where $recommended_release['core_compatible'] === FALSE in
// \Drupal\update\Form\UpdateManagerUpdate.
'b_fixture' => '1_2',
'compatible' => [],
'incompatible' => [
'AAA' => [
'recommended' => '8.x-1.2',
'range' => '8.1.0 to 8.1.1',
],
'BBB' => [
'recommended' => '8.x-1.2',
'range' => '8.1.0 to 8.1.1',
],
],
],
'one compatible, one incompatible' => [
'core_fixture' => '1.1-core_compatibility',
'a_fixture' => 'core_compatibility.8.x-1.2_8.x-2.2',
'b_fixture' => '1_1',
'compatible' => [
'BBB' => '8.x-1.1',
],
'incompatible' => [
'AAA' => [
'recommended' => '8.x-1.2',
'range' => '8.1.0 to 8.1.1',
],
],
],
];
}
/**
* Tests the Update form for a single test scenario of incompatible updates.
*
* @dataProvider incompatibleUpdatesTableProvider
*
* @param string $core_fixture
* The fixture file to use for Drupal core.
* @param string $a_fixture
* The fixture file to use for the aaa_update_test module.
* @param string $b_fixture
* The fixture file to use for the bbb_update_test module.
* @param string[] $compatible
* Compatible recommended updates (if any). Keys are module identifier
* ('AAA' or 'BBB') and values are the expected recommended release.
* @param string[][] $incompatible
* Incompatible recommended updates (if any). Keys are module identifier
* ('AAA' or 'BBB') and values are subarrays with the following keys:
* - 'recommended': The recommended version.
* - 'range': The versions of Drupal core required for that version.
*/
public function testIncompatibleUpdatesTable($core_fixture, $a_fixture, $b_fixture, array $compatible, array $incompatible) {
$assert_session = $this->assertSession();
$compatible_table_locator = '[data-drupal-selector="edit-projects"]';
$incompatible_table_locator = '[data-drupal-selector="edit-not-compatible"]';
$this->refreshUpdateStatus(['drupal' => $core_fixture, 'aaa_update_test' => $a_fixture, 'bbb_update_test' => $b_fixture]);
$this->drupalGet('admin/reports/updates/update');
if ($compatible) {
// Verify the number of rows in the table.
$assert_session->elementsCount('css', "$compatible_table_locator tbody tr", count($compatible));
// We never want to see a compatibility range in the compatible table.
$assert_session->elementTextNotContains('css', $compatible_table_locator, 'Requires Drupal core');
foreach ($compatible as $module => $version) {
$compatible_row = "$compatible_table_locator tbody tr:contains('$module Update test')";
// First <td> is the checkbox, so start with td #2.
$assert_session->elementTextContains('css', "$compatible_row td:nth-of-type(2)", "$module Update test");
// Both contrib modules use 8.x-1.0 as the currently installed version.
$assert_session->elementTextContains('css', "$compatible_row td:nth-of-type(3)", '8.x-1.0');
$assert_session->elementTextContains('css', "$compatible_row td:nth-of-type(4)", $version);
}
}
else {
// Verify there is no compatible updates table.
$assert_session->elementNotExists('css', $compatible_table_locator);
}
if ($incompatible) {
// Verify the number of rows in the table.
$assert_session->elementsCount('css', "$incompatible_table_locator tbody tr", count($incompatible));
foreach ($incompatible as $module => $data) {
$incompatible_row = "$incompatible_table_locator tbody tr:contains('$module Update test')";
$assert_session->elementTextContains('css', "$incompatible_row td:nth-of-type(1)", "$module Update test");
// Both contrib modules use 8.x-1.0 as the currently installed version.
$assert_session->elementTextContains('css', "$incompatible_row td:nth-of-type(2)", '8.x-1.0');
$assert_session->elementTextContains('css', "$incompatible_row td:nth-of-type(3)", $data['recommended']);
$assert_session->elementTextContains('css', "$incompatible_row td:nth-of-type(3)", 'Requires Drupal core: ' . $data['range']);
}
}
else {
// Verify there is no incompatible updates table.
$assert_session->elementNotExists('css', $incompatible_table_locator);
}
}
}
<?php
namespace Drupal\Tests\update\Functional;
use Drupal\Core\DrupalKernel;
use Drupal\Core\Link;
use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;
/**
* Defines some shared functions used by all update tests.
*
* The overarching methodology of these tests is we need to compare a given
* state of installed modules and themes (e.g., version, project grouping,
* timestamps, etc) against a current state of what the release history XML
* files we fetch say is available. We have dummy XML files (in the
* core/modules/update/tests directory) that describe various scenarios of
* what's available for different test projects, and we have dummy .info file
* data (specified via hook_system_info_alter() in the update_test helper
* module) describing what's currently installed. Each test case defines a set
* of projects to install, their current state (via the
* 'update_test_system_info' variable) and the desired available update data
* (via the 'update_test_xml_map' variable), and then performs a series of
* assertions that the report matches our expectations given the specific
* initial state and availability scenario.
*/
abstract class UpdateTestBase extends BrowserTestBase {
/**
* Denotes a security update will be required in the test case.
*/
const SECURITY_UPDATE_REQUIRED = 'SECURITY_UPDATE_REQUIRED';
/**
* Denotes an update will be available in the test case.
*/
const UPDATE_AVAILABLE = 'UPDATE_AVAILABLE';
/**
* Denotes no update will be available in the test case.
*/
const UPDATE_NONE = 'UPDATE_NONE';
/**
* The CSS locator for the update table run asserts on.
*
* @var string
*/
protected $updateTableLocator;
/**
* The project that is being tested.
*
* @var string
*/
protected $updateProject;
protected function setUp() {
parent::setUp();
// Change the root path which Update Manager uses to install and update
// projects to be inside the testing site directory. See
// \Drupal\update\UpdateRootFactory::get() for equivalent changes to the
// test child site.
$request = \Drupal::request();
$update_root = $this->container->get('update.root') . '/' . DrupalKernel::findSitePath($request);
$this->container->set('update.root', $update_root);
\Drupal::setContainer($this->container);
// Create the directories within the root path within which the Update
// Manager will install projects.
foreach (drupal_get_updaters() as $updater_info) {
$updater = $updater_info['class'];
$install_directory = $update_root . '/' . $updater::getRootDirectoryRelativePath();
if (!is_dir($install_directory)) {
mkdir($install_directory);
}
}
}
/**
* Refreshes the update status based on the desired available update scenario.
*
* @param $xml_map
* Array that maps project names to availability scenarios to fetch. The key
* '#all' is used if a project-specific mapping is not defined.
* @param $url
* (optional) A string containing the URL to fetch update data from.
* Defaults to 'update-test'.
*
* @see \Drupal\update_test\Controller\UpdateTestController::updateTest()
*/
protected function refreshUpdateStatus($xml_map, $url = 'update-test') {
// Tell the Update Manager module to fetch from the URL provided by
// update_test module.
$this->config('update.settings')->set('fetch.url', Url::fromUri('base:' . $url, ['absolute' => TRUE])->toString())->save();
// Save the map for UpdateTestController::updateTest() to use.
$this->config('update_test.settings')->set('xml_map', $xml_map)->save();
// Manually check the update status.
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
}
/**
* Runs a series of assertions that are applicable to all update statuses.
*/
protected function standardTests() {
$this->assertRaw('<h3>' . t('Drupal core') . '</h3>');
$this->assertRaw(Link::fromTextAndUrl(t('Drupal'), Url::fromUri('http://example.com/project/drupal'))->toString(), 'Link to the Drupal project appears.');
$this->assertNoText(t('No available releases found'));
}
/**
* Asserts the expected security updates are displayed correctly on the page.
*
* @param string $project_path_part
* The project path part needed for the download and release links.
* @param string[] $expected_security_releases
* The security releases, if any, that the status report should recommend.
* @param string $expected_update_message_type
* The type of update message expected.
* @param string $update_element_css_locator
* The CSS locator for the page element that contains the security updates.
*/
protected function assertSecurityUpdates($project_path_part, array $expected_security_releases, $expected_update_message_type, $update_element_css_locator) {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
$this->standardTests();
$assert_session->elementTextNotContains('css', $update_element_css_locator, 'Not supported');
$all_security_release_urls = array_map(function ($link) {
return $link->getAttribute('href');
}, $page->findAll('css', "$update_element_css_locator .version-security a[href$='-release']"));
$all_security_download_urls = array_map(function ($link) {
return $link->getAttribute('href');
}, $page->findAll('css', "$update_element_css_locator .version-security a[href$='.tar.gz']"));
if ($expected_security_releases) {
$expected_download_urls = [];
$expected_release_urls = [];
if ($expected_update_message_type === static::SECURITY_UPDATE_REQUIRED) {
$assert_session->elementTextNotContains('css', $update_element_css_locator, 'Update available');
$assert_session->elementTextContains('css', $update_element_css_locator, 'Security update required!');
$assert_session->responseContains('error.svg', 'Error icon was found.');
}
else {
$assert_session->elementTextContains('css', $update_element_css_locator, 'Update available');
$assert_session->elementTextNotContains('css', $update_element_css_locator, 'Security update required!');
}
$assert_session->elementTextNotContains('css', $update_element_css_locator, 'Up to date');
foreach ($expected_security_releases as $expected_security_release) {
$expected_url_version = str_replace('.', '-', $expected_security_release);
$release_url = "http://example.com/$project_path_part-$expected_url_version-release";
$download_url = "http://example.com/$project_path_part-$expected_url_version.tar.gz";
$expected_release_urls[] = $release_url;
$expected_download_urls[] = $download_url;
// Ensure the expected links are security links.
$this->assertContains($release_url, $all_security_release_urls, "Release $release_url is a security release link.");
$this->assertContains($download_url, $all_security_download_urls, "Release $download_url is a security download link.");
$assert_session->linkByHrefExists($release_url);
$assert_session->linkByHrefExists($download_url);
}
// Ensure no other links are shown as security releases.
$this->assertEquals([], array_diff($all_security_release_urls, $expected_release_urls));
$this->assertEquals([], array_diff($all_security_download_urls, $expected_download_urls));
}
else {
// Ensure there were no security links.
$this->assertEquals([], $all_security_release_urls);
$this->assertEquals([], $all_security_download_urls);
$assert_session->pageTextNotContains('Security update required!');
if ($expected_update_message_type === static::UPDATE_AVAILABLE) {
$assert_session->elementTextContains('css', $update_element_css_locator, 'Update available');
$assert_session->elementTextNotContains('css', $update_element_css_locator, 'Up to date');
}
elseif ($expected_update_message_type === static::UPDATE_NONE) {
$assert_session->elementTextNotContains('css', $update_element_css_locator, 'Update available');
$assert_session->elementTextContains('css', $update_element_css_locator, 'Up to date');
}
else {
$this->fail('Unexpected value for $expected_update_message_type: ' . $expected_update_message_type);
}
}
}
/**
* Asserts that an update version has the correct links.
*
* @param string $label
* The label for the update.
* @param string $version
* The project version.
* @param string|null $download_version
* (optional) The version number as it appears in the download link. If
* $download_version is not provided then $version will be used.
*/
protected function assertVersionUpdateLinks($label, $version, $download_version = NULL) {
$download_version = $download_version ?? $version;
$update_element = $this->findUpdateElementByLabel($label);
// In the release notes URL the periods are replaced with dashes.
$url_version = str_replace('.', '-', $version);
$this->assertEquals($update_element->findLink($version)->getAttribute('href'), "http://example.com/{$this->updateProject}-$url_version-release");
$this->assertEquals($update_element->findLink('Download')->getAttribute('href'), "http://example.com/{$this->updateProject}-$download_version.tar.gz");
$this->assertEquals($update_element->findLink('Release notes')->getAttribute('href'), "http://example.com/{$this->updateProject}-$url_version-release");
}
/**
* Confirms messages are correct when a release has been unpublished/revoked.
*
* @param string $revoked_version
* The revoked version that is currently installed.
* @param string $newer_version
* The expected newer version to recommend.
* @param string $new_version_label
* The expected label for the newer version (for example 'Recommended
* version:' or 'Also available:').
*/
protected function confirmRevokedStatus($revoked_version, $newer_version, $new_version_label) {
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertUpdateTableTextContains('Revoked!');
$this->assertUpdateTableTextContains($revoked_version);
$this->assertUpdateTableElementContains('error.svg');
$this->assertUpdateTableTextContains('Release revoked: Your currently installed release has been revoked, and is no longer available for download. Disabling everything included in this release or upgrading is strongly recommended!');
$this->assertVersionUpdateLinks($new_version_label, $newer_version);
}
/**
* Confirms messages are correct when a release has been marked unsupported.
*
* @param string $unsupported_version
* The unsupported version that is currently installed.
* @param string $newer_version
* The expected newer version to recommend.
* @param string $new_version_label
* The expected label for the newer version (for example 'Recommended
* version:' or 'Also available:').
*/
protected function confirmUnsupportedStatus($unsupported_version, $newer_version, $new_version_label) {
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertUpdateTableTextContains('Not supported!');
$this->assertUpdateTableTextContains($unsupported_version);
$this->assertUpdateTableElementContains('error.svg');
$this->assertUpdateTableTextContains('Release not supported: Your currently installed release is now unsupported, and is no longer available for download. Disabling everything included in this release or upgrading is strongly recommended!');
$this->assertVersionUpdateLinks($new_version_label, $newer_version);
}
/**
* Asserts that the update table text contains the specified text.
*
* @param string $text
* The expected text.
*
* @see \Behat\Mink\WebAssert::elementTextContains()
*/
protected function assertUpdateTableTextContains($text) {
$this->assertSession()
->elementTextContains('css', $this->updateTableLocator, $text);
}
/**
* Asserts that the update table element HTML contains the specified text.
*
* @param string $text
* The expected text.
*
* @see \Behat\Mink\WebAssert::elementContains()
*/
protected function assertUpdateTableElementContains($text) {
$this->assertSession()
->elementContains('css', $this->updateTableLocator, $text);
}
/**
* Finds an update page element by label.
*
* @param string $label
* The label for the update, for example "Recommended version:" or
* "Latest version:".
*
* @return \Behat\Mink\Element\NodeElement
* The update element.
*/
protected function findUpdateElementByLabel($label) {
$update_elements = $this->getSession()->getPage()
->findAll('css', $this->updateTableLocator . " .project-update__version:contains(\"$label\")");
$this->assertCount(1, $update_elements);
return $update_elements[0];
}
}
<?php
namespace Drupal\Tests\update\Functional;
use Drupal\Core\Extension\InfoParserDynamic;
use Drupal\Core\Updater\Updater;
use Drupal\Core\Url;
use Drupal\Tests\TestFileCreationTrait;
/**
* Tests the Update Manager module's upload and extraction functionality.
*
* @group update
*/
class UpdateUploadTest extends UpdateTestBase {
use TestFileCreationTrait {
getTestFiles as drupalGetTestFiles;
}
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['update', 'update_test'];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
protected function setUp() {
parent::setUp();
$admin_user = $this->drupalCreateUser([
'administer modules',
'administer software updates',
'administer site configuration',
]);
$this->drupalLogin($admin_user);
}
/**
* Tests upload, extraction, and update of a module.
*/
public function testUploadModule() {
// Ensure that the update information is correct before testing.
update_get_available(TRUE);
// Images are not valid archives, so get one and try to install it. We
// need an extra variable to store the result of drupalGetTestFiles()
// since reset() takes an argument by reference and passing in a constant
// emits a notice in strict mode.
$imageTestFiles = $this->drupalGetTestFiles('image');
$invalidArchiveFile = reset($imageTestFiles);
$edit = [
'files[project_upload]' => $invalidArchiveFile->uri,
];
// This also checks that the correct archive extensions are allowed.
$this->drupalPostForm('admin/modules/install', $edit, t('Install'));
$extensions = \Drupal::service('plugin.manager.archiver')->getExtensions();
$this->assertSession()->pageTextContains(t('Only files with the following extensions are allowed: @archive_extensions.', ['@archive_extensions' => $extensions]));
$this->assertUrl('admin/modules/install');
// Check to ensure an existing module can't be reinstalled. Also checks that
// the archive was extracted since we can't know if the module is already
// installed until after extraction.
$validArchiveFile = __DIR__ . '/../../aaa_update_test.tar.gz';
$edit = [
'files[project_upload]' => $validArchiveFile,
];
$this->drupalPostForm('admin/modules/install', $edit, t('Install'));
$this->assertText(t('@module_name is already installed.', ['@module_name' => 'AAA Update test']), 'Existing module was extracted and not reinstalled.');
$this->assertUrl('admin/modules/install');
// Ensure that a new module can be extracted and installed.
$updaters = drupal_get_updaters();
$moduleUpdater = $updaters['module']['class'];
$installedInfoFilePath = $this->container->get('update.root') . '/' . $moduleUpdater::getRootDirectoryRelativePath() . '/update_test_new_module/update_test_new_module.info.yml';
$this->assertFileNotExists($installedInfoFilePath);
$validArchiveFile = __DIR__ . '/../../update_test_new_module/8.x-1.0/update_test_new_module.tar.gz';
$edit = [
'files[project_upload]' => $validArchiveFile,
];
$this->drupalPostForm('admin/modules/install', $edit, t('Install'));
// Check that submitting the form takes the user to authorize.php.
$this->assertUrl('core/authorize.php');
$this->assertTitle('Update manager | Drupal');
// Check for a success message on the page, and check that the installed
// module now exists in the expected place in the filesystem.
$this->assertRaw(t('Installed %project_name successfully', ['%project_name' => 'update_test_new_module']));
$this->assertFileExists($installedInfoFilePath);
// Ensure the links are relative to the site root and not
// core/authorize.php.
$this->assertSession()->linkExists(t('Install another module'));
$this->assertLinkByHref(Url::fromRoute('update.module_install')->toString());
$this->assertSession()->linkExists(t('Enable newly added modules'));
$this->assertLinkByHref(Url::fromRoute('system.modules_list')->toString());
$this->assertSession()->linkExists(t('Administration pages'));
$this->assertLinkByHref(Url::fromRoute('system.admin')->toString());
// Ensure we can reach the "Install another module" link.
$this->clickLink(t('Install another module'));
$this->assertSession()->statusCodeEquals(200);
$this->assertUrl('admin/modules/install');
// Check that the module has the correct version before trying to update
// it. Since the module is installed in sites/simpletest, which only the
// child site has access to, standard module API functions won't find it
// when called here. To get the version, the info file must be parsed
// directly instead.
$info_parser = new InfoParserDynamic(DRUPAL_ROOT);
$info = $info_parser->parse($installedInfoFilePath);
$this->assertEqual($info['version'], '8.x-1.0');
// Enable the module.
$this->drupalPostForm('admin/modules', ['modules[update_test_new_module][enable]' => TRUE], t('Install'));
// Define the update XML such that the new module downloaded above needs an
// update from 8.x-1.0 to 8.x-1.1.
$update_test_config = $this->config('update_test.settings');
$system_info = [
'update_test_new_module' => [
'project' => 'update_test_new_module',
],
];
$update_test_config->set('system_info', $system_info)->save();
$xml_mapping = [
'update_test_new_module' => '1_1',
];
$this->refreshUpdateStatus($xml_mapping);
// Run the updates for the new module.
$this->drupalPostForm('admin/reports/updates/update', ['projects[update_test_new_module]' => TRUE], t('Download these updates'));
$this->drupalPostForm(NULL, ['maintenance_mode' => FALSE], t('Continue'));
$this->assertText(t('Update was completed successfully.'));
$this->assertRaw(t('Installed %project_name successfully', ['%project_name' => 'update_test_new_module']));
// Parse the info file again to check that the module has been updated to
// 8.x-1.1.
$info = $info_parser->parse($installedInfoFilePath);
$this->assertEqual($info['version'], '8.x-1.1');
}
/**
* Ensures that archiver extensions are properly merged in the UI.
*/
public function testFileNameExtensionMerging() {
$this->drupalGet('admin/modules/install');
// Make sure the bogus extension supported by update_test.module is there.
$this->assertPattern('/file extensions are supported:.*update-test-extension/');
// Make sure it didn't clobber the first option from core.
$this->assertPattern('/file extensions are supported:.*tar/');
}
/**
* Checks the messages on update manager pages when missing a security update.
*/
public function testUpdateManagerCoreSecurityUpdateMessages() {
$setting = [
'#all' => [
'version' => '8.0.0',
],
];
$this->config('update_test.settings')
->set('system_info', $setting)
->set('xml_map', ['drupal' => '0.2-sec'])
->save();
$this->config('update.settings')
->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
->save();
// Initialize the update status.
$this->drupalGet('admin/reports/updates');
// Now, make sure none of the Update manager pages have duplicate messages
// about core missing a security update.
$this->drupalGet('admin/modules/install');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->drupalGet('admin/modules/update');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->drupalGet('admin/appearance/install');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->drupalGet('admin/appearance/update');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->drupalGet('admin/reports/updates/install');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->drupalGet('admin/reports/updates/update');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->drupalGet('admin/update/ready');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
}
/**
* Tests only an *.info.yml file are detected without supporting files.
*/
public function testUpdateDirectory() {
$type = Updater::getUpdaterFromDirectory($this->root . '/core/modules/update/tests/modules/aaa_update_test');
$this->assertEqual($type, 'Drupal\\Core\\Updater\\Module', 'Detected a Module');
$type = Updater::getUpdaterFromDirectory($this->root . '/core/modules/update/tests/themes/update_test_basetheme');
$this->assertEqual($type, 'Drupal\\Core\\Updater\\Theme', 'Detected a Theme.');
}
}
<?php
namespace Drupal\Tests\update\Kernel\Migrate\d6;
use Drupal\Tests\SchemaCheckTestTrait;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade variables to update.settings.yml.
*
* @group migrate_drupal_6
*/
class MigrateUpdateConfigsTest extends MigrateDrupal6TestBase {
use SchemaCheckTestTrait;
/**
* {@inheritdoc}
*/
public static $modules = ['update'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('update_settings');
}
/**
* Tests migration of update variables to update.settings.yml.
*/
public function testUpdateSettings() {
$config = $this->config('update.settings');
$this->assertIdentical(2, $config->get('fetch.max_attempts'));
$this->assertIdentical('http://updates.drupal.org/release-history', $config->get('fetch.url'));
$this->assertIdentical('all', $config->get('notification.threshold'));
$this->assertIdentical([], $config->get('notification.emails'));
$this->assertIdentical(7, $config->get('check.interval_days'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'update.settings', $config->get());
}
}
<?php
namespace Drupal\Tests\update\Kernel;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests the update_delete_file_if_stale() function.
*
* @group update
*/
class UpdateDeleteFileIfStaleTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'system',
'update',
];
/**
* Tests the deletion of stale files.
*/
public function testUpdateDeleteFileIfStale() {
$file_system = $this->container->get('file_system');
$file_name = $file_system->saveData($this->randomMachineName(), 'public://');
$this->assertNotNull($file_name);
// During testing the file change and the stale checking occurs in the same
// request, so the beginning of request will be before the file changes and
// REQUEST_TIME - $filectime is negative or zero. Set the maximum age to a
// number even smaller than that.
$this->config('system.file')
->set('temporary_maximum_age', -100000)
->save();
$file_path = $file_system->realpath($file_name);
update_delete_file_if_stale($file_path);
$this->assertFileNotExists($file_path);
}
}
<?php
namespace Drupal\Tests\update\Kernel;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests update report functionality.
*
* @covers template_preprocess_update_report()
* @group update
*/
class UpdateReportTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'system',
'update',
];
/**
* @dataProvider providerTemplatePreprocessUpdateReport
*/
public function testTemplatePreprocessUpdateReport($variables) {
\Drupal::moduleHandler()->loadInclude('update', 'inc', 'update.report');
// The function should run without an exception being thrown when the value
// of $variables['data'] is not set or is not an array.
template_preprocess_update_report($variables);
// Test that the key "no_updates_message" has been set.
$this->assertArrayHasKey('no_updates_message', $variables);
}
/**
* Provides data for testTemplatePreprocessUpdateReport().
*
* @return array
* Array of $variables for template_preprocess_update_report().
*/
public function providerTemplatePreprocessUpdateReport() {
return [
'$variables with data not set' => [
[],
],
'$variables with data as an interger' => [
['data' => 4],
],
'$variables with data as a string' => [
['data' => 'I am a string'],
],
];
}
}
<?php
namespace Drupal\Tests\update\Unit\Menu;
use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
/**
* Tests existence of update local tasks.
*
* @group update
*/
class UpdateLocalTasksTest extends LocalTaskIntegrationTestBase {
protected function setUp() {
$this->directoryList = ['update' => 'core/modules/update'];
parent::setUp();
}
/**
* Checks update report tasks.
*
* @dataProvider getUpdateReportRoutes
*/
public function testUpdateReportLocalTasks($route) {
$this->assertLocalTasks($route, [
0 => ['update.status', 'update.settings', 'update.report_update'],
]);
}
/**
* Provides a list of report routes to test.
*/
public function getUpdateReportRoutes() {
return [
['update.status'],
['update.settings'],
['update.report_update'],
];
}
/**
* Checks update module tasks.
*
* @dataProvider getUpdateModuleRoutes
*/
public function testUpdateModuleLocalTasks($route) {
$this->assertLocalTasks($route, [
0 => ['update.module_update'],
]);
}
/**
* Provides a list of module routes to test.
*/
public function getUpdateModuleRoutes() {
return [
['update.module_update'],
];
}
/**
* Checks update theme tasks.
*
* @dataProvider getUpdateThemeRoutes
*/
public function testUpdateThemeLocalTasks($route) {
$this->assertLocalTasks($route, [
0 => ['update.theme_update'],
]);
}
/**
* Provides a list of theme routes to test.
*/
public function getUpdateThemeRoutes() {
return [
['update.theme_update'],
];
}
}
<?php
namespace Drupal\Tests\update\Unit;
use Drupal\Tests\UnitTestCase;
use Drupal\update\ModuleVersion;
/**
* @coversDefaultClass \Drupal\update\ModuleVersion
*
* @group update
*/
class ModuleVersionTest extends UnitTestCase {
/**
* @covers ::getMajorVersion
*
* @dataProvider providerVersionInfos
*
* @param string $version
* The version string to test.
* @param array $expected_version_info
* The expected version information.
*/
public function testGetMajorVersion($version, array $expected_version_info) {
$version = ModuleVersion::createFromVersionString($version);
$this->assertSame($expected_version_info['major'], $version->getMajorVersion());
}
/**
* @covers ::getVersionExtra
*
* @dataProvider providerVersionInfos
*
* @param string $version
* The version string to test.
* @param array $expected_version_info
* The expected version information.
*/
public function testGetVersionExtra($version, array $expected_version_info) {
$version = ModuleVersion::createFromVersionString($version);
$this->assertSame($expected_version_info['extra'], $version->getVersionExtra());
}
/**
* Data provider for expected version information.
*
* @return array
* Arrays of version information.
*/
public function providerVersionInfos() {
// Data provider values are:
// - The version number to test.
// - Array of expected version information with the following keys:
// -'major': The expected result from ::getMajorVersion().
// -'extra': The expected result from ::getVersionExtra().
return [
'8.x-1.3' => [
'8.x-1.3',
[
'major' => '1',
'extra' => NULL,
],
],
'8.x-1.0' => [
'8.x-1.0',
[
'major' => '1',
'extra' => NULL,
],
],
'8.x-1.0-alpha1' => [
'8.x-1.0-alpha1',
[
'major' => '1',
'extra' => 'alpha1',
],
],
'8.x-1.3-alpha1' => [
'8.x-1.3-alpha1',
[
'major' => '1',
'extra' => 'alpha1',
],
],
'0.1' => [
'0.1',
[
'major' => '0',
'extra' => NULL,
],
],
'1.0' => [
'1.0',
[
'major' => '1',
'extra' => NULL,
],
],
'1.3' => [
'1.3',
[
'major' => '1',
'extra' => NULL,
],
],
'1.0-alpha1' => [
'1.0-alpha1',
[
'major' => '1',
'extra' => 'alpha1',
],
],
'1.3-alpha1' => [
'1.3-alpha1',
[
'major' => '1',
'extra' => 'alpha1',
],
],
'0.2.0' => [
'0.2.0',
[
'major' => '0',
'extra' => NULL,
],
],
'1.2.0' => [
'1.2.0',
[
'major' => '1',
'extra' => NULL,
],
],
'1.0.3' => [
'1.0.3',
[
'major' => '1',
'extra' => NULL,
],
],
'1.2.3' => [
'1.2.3',
[
'major' => '1',
'extra' => NULL,
],
],
'1.2.0-alpha1' => [
'1.2.0-alpha1',
[
'major' => '1',
'extra' => 'alpha1',
],
],
'1.2.3-alpha1' => [
'1.2.3-alpha1',
[
'major' => '1',
'extra' => 'alpha1',
],
],
'8.x-1.x-dev' => [
'8.x-1.x-dev',
[
'major' => '1',
'extra' => 'dev',
],
],
'8.x-8.x-dev' => [
'8.x-8.x-dev',
[
'major' => '8',
'extra' => 'dev',
],
],
'1.x-dev' => [
'1.x-dev',
[
'major' => '1',
'extra' => 'dev',
],
],
'8.x-dev' => [
'8.x-dev',
[
'major' => '8',
'extra' => 'dev',
],
],
'1.0.x-dev' => [
'1.0.x-dev',
[
'major' => '1',
'extra' => 'dev',
],
],
'1.2.x-dev' => [
'1.2.x-dev',
[
'major' => '1',
'extra' => 'dev',
],
],
];
}
/**
* @covers ::createFromVersionString
*
* @dataProvider providerInvalidVersionNumber
*
* @param string $version
* The version string to test.
*/
public function testInvalidVersionNumber($version) {
$this->expectException(\UnexpectedValueException::class);
$this->expectExceptionMessage("Unexpected version number in: $version");
ModuleVersion::createFromVersionString($version);
}
/**
* Data provider for testInvalidVersionNumber().
*/
public function providerInvalidVersionNumber() {
return static::createKeyedTestCases([
'',
'8',
'x',
'xx',
'8.x-',
'8.x',
'.x',
'.0',
'.1',
'.1.0',
'1.0.',
'x.1',
'1.x.0',
'1.1.x',
'1.1.x-extra',
'x.1.1',
'1.1.1.1',
'1.1.1.0',
]);
}
/**
* @covers ::createFromVersionString
*
* @dataProvider providerInvalidVersionCorePrefix
*
* @param string $version
* The version string to test.
*/
public function testInvalidVersionCorePrefix($version) {
$this->expectException(\UnexpectedValueException::class);
$this->expectExceptionMessage("Unexpected version core prefix in $version. The only core prefix expected in \Drupal\update\ModuleVersion is: 8.x-");
ModuleVersion::createFromVersionString($version);
}
/**
* Data provider for testInvalidVersionCorePrefix().
*/
public function providerInvalidVersionCorePrefix() {
return static::createKeyedTestCases([
'6.x-1.0',
'7.x-1.x',
'9.x-1.x',
'10.x-1.x',
]);
}
/**
* @covers ::createFromSupportBranch
*
* @dataProvider providerInvalidBranchCorePrefix
*
* @param string $branch
* The branch to test.
*/
public function testInvalidBranchCorePrefix($branch) {
$this->expectException(\UnexpectedValueException::class);
$this->expectExceptionMessage("Unexpected version core prefix in {$branch}0. The only core prefix expected in \Drupal\update\ModuleVersion is: 8.x-");
ModuleVersion::createFromSupportBranch($branch);
}
/**
* Data provider for testInvalidBranchCorePrefix().
*/
public function providerInvalidBranchCorePrefix() {
return static::createKeyedTestCases([
'6.x-1.',
'7.x-1.',
'9.x-1.',
'10.x-1.',
]);
}
/**
* @covers ::createFromSupportBranch
*
* @dataProvider providerCreateFromSupportBranch
*
* @param string $branch
* The branch to test.
* @param string $expected_major
* The expected major version.
*/
public function testCreateFromSupportBranch($branch, $expected_major) {
$version = ModuleVersion::createFromSupportBranch($branch);
$this->assertInstanceOf(ModuleVersion::class, $version);
$this->assertSame($expected_major, $version->getMajorVersion());
// Version extra can't be determined from a branch.
$this->assertSame(NULL, $version->getVersionExtra());
}
/**
* Data provider for testCreateFromSupportBranch().
*/
public function providerCreateFromSupportBranch() {
// Data provider values are:
// - The version number to test.
// - Array of expected version information with the following keys:
// -'major': The expected result from ::getMajorVersion().
// -'extra': The expected result from ::getVersionExtra().
return [
'0.' => [
'0.',
'0',
],
'1.' => [
'1.',
'1',
],
'0.1.' => [
'0.1.',
'0',
],
'1.2.' => [
'1.2.',
'1',
],
'8.x-1.' => [
'8.x-1.',
'1',
],
];
}
/**
* @covers ::createFromSupportBranch
*
* @dataProvider provideInvalidBranch
*
* @param string $branch
* The branch to test.
*/
public function testInvalidBranch($branch) {
$this->expectException(\UnexpectedValueException::class);
$this->expectExceptionMessage("Invalid support branch: $branch");
ModuleVersion::createFromSupportBranch($branch);
}
/**
* Data provider for testInvalidBranch().
*/
public function provideInvalidBranch() {
return self::createKeyedTestCases([
'8.x-1.0',
'8.x-2.x',
'2.x-1.0',
'1.1',
'1.x',
'1.1.x',
'1.1.1',
'1.1.1.1',
]);
}
/**
* Creates test case arrays for data provider methods.
*
* @param string[] $test_arguments
* The test arguments.
*
* @return array
* An array with $test_arguments as keys and each element of $test_arguments
* as a single item array
*/
protected static function createKeyedTestCases(array $test_arguments) {
return array_combine(
$test_arguments,
array_map(function ($test_argument) {
return [$test_argument];
}, $test_arguments)
);
}
}
<?php
namespace Drupal\Tests\update\Unit;
use Drupal\Tests\UnitTestCase;
use Drupal\update\ProjectCoreCompatibility;
/**
* @coversDefaultClass \Drupal\update\ProjectCoreCompatibility
*
* @group update
*/
class ProjectCoreCompatibilityTest extends UnitTestCase {
/**
* @covers ::setReleaseMessage
* @dataProvider providerSetProjectCoreCompatibilityRanges
*/
public function testSetProjectCoreCompatibilityRanges(array $project_data, $core_data, array $core_releases, array $expected_releases, array $expected_security_updates) {
$project_compatibility = new ProjectCoreCompatibility($core_data, $core_releases);
$project_compatibility->setStringTranslation($this->getStringTranslationStub());
$project_compatibility->setReleaseMessage($project_data);
$this->assertSame($expected_releases, $project_data['releases']);
$this->assertSame($expected_security_updates, $project_data['security updates']);
}
/**
* Data provider for testSetProjectCoreCompatibilityRanges().
*/
public function providerSetProjectCoreCompatibilityRanges() {
$test_cases['no 9 releases'] = [
'project_data' => [
'recommended' => '1.0.1',
'latest_version' => '1.2.3',
'also' => [
'1.2.4',
'1.2.5',
'1.2.6',
],
'releases' => [
'1.0.1' => [
'core_compatibility' => '8.x',
],
'1.2.3' => [
'core_compatibility' => '^8.9 || ^9',
],
'1.2.4' => [
'core_compatibility' => '^8.9.2 || ^9',
],
'1.2.6' => [],
],
'security updates' => [
'1.2.5' => [
'core_compatibility' => '8.9.0 || 8.9.2 || ^9.0.1',
],
],
],
'core_data' => [
'existing_version' => '8.8.0',
],
'core_releases' => [
'8.8.0-alpha1' => [],
'8.8.0-beta1' => [],
'8.8.0-rc1' => [],
'8.8.0' => [],
'8.8.1' => [],
'8.8.2' => [],
'8.9.0' => [],
'8.9.1' => [],
'8.9.2' => [],
],
'expected_releases' => [
'1.0.1' => [
'core_compatibility' => '8.x',
'core_compatible' => TRUE,
'core_compatibility_message' => 'Requires Drupal core: 8.8.0 to 8.9.2',
],
'1.2.3' => [
'core_compatibility' => '^8.9 || ^9',
'core_compatible' => FALSE,
'core_compatibility_message' => 'Requires Drupal core: 8.9.0 to 8.9.2',
],
'1.2.4' => [
'core_compatibility' => '^8.9.2 || ^9',
'core_compatible' => FALSE,
'core_compatibility_message' => 'Requires Drupal core: 8.9.2',
],
'1.2.6' => [],
],
'expected_security_updates' => [
'1.2.5' => [
'core_compatibility' => '8.9.0 || 8.9.2 || ^9.0.1',
'core_compatible' => FALSE,
'core_compatibility_message' => 'Requires Drupal core: 8.9.0, 8.9.2',
],
],
];
// Ensure that when only Drupal 9 pre-releases none of the expected ranges
// change.
$test_cases['with 9 pre releases'] = $test_cases['no 9 releases'];
$test_cases['with 9 pre releases']['core_releases'] += [
'9.0.0-alpha1' => [],
'9.0.0-beta1' => [],
'9.0.0-rc1' => [],
];
// Ensure that when the Drupal 9 full release are added the expected ranges
// do change.
$test_cases['with 9 full releases'] = $test_cases['with 9 pre releases'];
$test_cases['with 9 full releases']['core_releases'] += [
'9.0.0' => [],
'9.0.1' => [],
'9.0.2' => [],
];
$test_cases['with 9 full releases']['expected_releases'] = [
'1.0.1' => [
'core_compatibility' => '8.x',
'core_compatible' => TRUE,
'core_compatibility_message' => 'Requires Drupal core: 8.8.0 to 8.9.2',
],
'1.2.3' => [
'core_compatibility' => '^8.9 || ^9',
'core_compatible' => FALSE,
'core_compatibility_message' => 'Requires Drupal core: 8.9.0 to 9.0.2',
],
'1.2.4' => [
'core_compatibility' => '^8.9.2 || ^9',
'core_compatible' => FALSE,
'core_compatibility_message' => 'Requires Drupal core: 8.9.2 to 9.0.2',
],
'1.2.6' => [],
];
$test_cases['with 9 full releases']['expected_security_updates'] = [
'1.2.5' => [
'core_compatibility' => '8.9.0 || 8.9.2 || ^9.0.1',
'core_compatible' => FALSE,
'core_compatibility_message' => 'Requires Drupal core: 8.9.0, 8.9.2, 9.0.1 to 9.0.2',
],
];
return $test_cases;
}
}
<?php
namespace Drupal\Tests\update\Unit;
use Drupal\Tests\UnitTestCase;
use Drupal\update\UpdateFetcher;
/**
* Tests update functionality unrelated to the database.
*
* @group update
*/
class UpdateFetcherTest extends UnitTestCase {
/**
* The update fetcher to use.
*
* @var \Drupal\update\UpdateFetcher
*/
protected $updateFetcher;
/**
* {@inheritdoc}
*/
protected function setUp() {
$config_factory = $this->getConfigFactoryStub(['update.settings' => ['fetch_url' => 'http://www.example.com']]);
$http_client_mock = $this->createMock('\GuzzleHttp\ClientInterface');
$this->updateFetcher = new UpdateFetcher($config_factory, $http_client_mock);
}
/**
* Tests that buildFetchUrl() builds the URL correctly.
*
* @param array $project
* A keyed array of project information matching results from
* \Drupal\update\UpdateManager::getProjects().
* @param string $site_key
* A string to mimic an anonymous site key hash.
* @param string $expected
* The expected url returned from UpdateFetcher::buildFetchUrl()
*
* @dataProvider providerTestUpdateBuildFetchUrl
*
* @see \Drupal\update\UpdateFetcher::buildFetchUrl()
*/
public function testUpdateBuildFetchUrl(array $project, $site_key, $expected) {
$url = $this->updateFetcher->buildFetchUrl($project, $site_key);
$this->assertEquals($url, $expected);
}
/**
* Provide test data for self::testUpdateBuildFetchUrl().
*
* @return array
* An array of arrays, each containing:
* - 'project' - An array matching a project's .info file structure.
* - 'site_key' - An arbitrary site key.
* - 'expected' - The expected url from UpdateFetcher::buildFetchUrl().
*/
public function providerTestUpdateBuildFetchUrl() {
$data = [];
// First test that we didn't break the trivial case.
$project['name'] = 'update_test';
$project['project_type'] = '';
$project['info']['version'] = '';
$project['info']['project status url'] = 'http://www.example.com';
$project['includes'] = ['module1' => 'Module 1', 'module2' => 'Module 2'];
$site_key = '';
$expected = "http://www.example.com/{$project['name']}/current";
$data[] = [$project, $site_key, $expected];
// For disabled projects it shouldn't add the site key either.
$site_key = 'site_key';
$project['project_type'] = 'disabled';
$expected = "http://www.example.com/{$project['name']}/current";
$data[] = [$project, $site_key, $expected];
// For enabled projects, test adding the site key.
$project['project_type'] = '';
$expected = "http://www.example.com/{$project['name']}/current";
$expected .= '?site_key=site_key';
$expected .= '&list=' . rawurlencode('module1,module2');
$data[] = [$project, $site_key, $expected];
// Test when the URL contains a question mark.
$project['info']['project status url'] = 'http://www.example.com/?project=';
$expected = "http://www.example.com/?project=/{$project['name']}/current";
$expected .= '&site_key=site_key';
$expected .= '&list=' . rawurlencode('module1,module2');
$data[] = [$project, $site_key, $expected];
return $data;
}
}
name: 'Update test base theme'
type: theme
base theme: stable
description: 'Test theme which acts as a base theme for other test subthemes.'
version: VERSION
core: 8.x
name: 'Update test subtheme'
type: theme
description: 'Test theme which uses update_test_basetheme as the base theme.'
version: VERSION
core: 8.x
base theme: update_test_basetheme
<?php
/**
* @file
* Hooks provided by the Update Manager module.
*/
use Drupal\update\UpdateFetcherInterface;
/**
* @addtogroup hooks
* @{
*/
/**
* Alter the list of projects before fetching data and comparing versions.
*
* Most modules will never need to implement this hook. It is for advanced
* interaction with the Update Manager module. The primary use-case for this
* hook is to add projects to the list; for example, to provide update status
* data on disabled modules and themes. A contributed module might want to hide
* projects from the list; for example, if there is a site-specific module that
* doesn't have any official releases, that module could remove itself from this
* list to avoid "No available releases found" warnings on the available updates
* report. In rare cases, a module might want to alter the data associated with
* a project already in the list.
*
* @param $projects
* Reference to an array of the projects installed on the system. This
* includes all the metadata documented in the comments below for each project
* (either module or theme) that is currently enabled. The array is initially
* populated inside \Drupal\update\UpdateManager::getProjects() with the help
* of \Drupal\Core\Utility\ProjectInfo->processInfoList(), so look there for
* examples of how to populate the array with real values.
*
* @see \Drupal\update\UpdateManager::getProjects()
* @see \Drupal\Core\Utility\ProjectInfo::processInfoList()
*/
function hook_update_projects_alter(&$projects) {
// Hide a site-specific module from the list.
unset($projects['site_specific_module']);
// Add a disabled module to the list.
// The key for the array should be the machine-readable project "short name".
$projects['disabled_project_name'] = [
// Machine-readable project short name (same as the array key above).
'name' => 'disabled_project_name',
// Array of values from the main .info.yml file for this project.
'info' => [
'name' => 'Some disabled module',
'description' => 'A module not enabled on the site that you want to see in the available updates report.',
'version' => '8.x-1.0',
'core' => '8.x',
// The maximum file change time (the "ctime" returned by the filectime()
// PHP method) for all of the .info.yml files included in this project.
'_info_file_ctime' => 1243888165,
],
// The date stamp when the project was released, if known. If the disabled
// project was an officially packaged release from drupal.org, this will
// be included in the .info.yml file as the 'datestamp' field. This only
// really matters for development snapshot releases that are regenerated,
// so it can be left undefined or set to 0 in most cases.
'datestamp' => 1243888185,
// Any modules (or themes) included in this project. Keyed by machine-
// readable "short name", value is the human-readable project name printed
// in the UI.
'includes' => [
'disabled_project' => 'Disabled module',
'disabled_project_helper' => 'Disabled module helper module',
'disabled_project_foo' => 'Disabled module foo add-on module',
],
// Does this project contain a 'module', 'theme', 'disabled-module', or
// 'disabled-theme'?
'project_type' => 'disabled-module',
];
}
/**
* Alter the information about available updates for projects.
*
* @param $projects
* Reference to an array of information about available updates to each
* project installed on the system.
*
* @see update_calculate_project_data()
*/
function hook_update_status_alter(&$projects) {
$settings = \Drupal::config('update_advanced.settings')->get('projects');
foreach ($projects as $project => $project_info) {
if (isset($settings[$project]) && isset($settings[$project]['check']) &&
($settings[$project]['check'] == 'never' ||
(isset($project_info['recommended']) &&
$settings[$project]['check'] === $project_info['recommended']))) {
$projects[$project]['status'] = UpdateFetcherInterface::NOT_CHECKED;
$projects[$project]['reason'] = t('Ignored from settings');
if (!empty($settings[$project]['notes'])) {
$projects[$project]['extra'][] = [
'class' => ['admin-note'],
'label' => t('Administrator note'),
'data' => $settings[$project]['notes'],
];
}
}
}
}
/**
* Verify an archive after it has been downloaded and extracted.
*
* @param string $project
* The short name of the project that has been downloaded.
* @param string $archive_file
* The filename of the unextracted archive.
* @param string $directory
* The directory that the archive was extracted into.
*
* @return
* If there are any problems, return an array of error messages. If there are
* no problems, return an empty array.
*
* @see update_manager_archive_verify()
* @ingroup update_manager_file
*/
function hook_verify_update_archive($project, $archive_file, $directory) {
$errors = [];
if (!file_exists($directory)) {
$errors[] = t('The %directory does not exist.', ['%directory' => $directory]);
}
// Add other checks on the archive integrity here.
return $errors;
}
/**
* @} End of "addtogroup hooks".
*/
<?php
/**
* @file
* Callbacks and related functions invoked by authorize.php to update projects.
*
* We use the Batch API to actually update each individual project on the site.
* All of the code in this file is run at a low bootstrap level (modules are not
* loaded), so these functions cannot assume access to the rest of the code of
* the Update Manager module.
*/
use Drupal\Core\Updater\UpdaterException;
use Drupal\Core\Url;
/**
* Updates existing projects when invoked by authorize.php.
*
* Callback for system_authorized_init() in
* update_manager_update_ready_form_submit().
*
* @param $filetransfer
* The FileTransfer object created by authorize.php for use during this
* operation.
* @param $projects
* A nested array of projects to install into the live webroot, keyed by
* project name. Each subarray contains the following keys:
* - project: The canonical project short name.
* - updater_name: The name of the Drupal\Core\Updater\Updater class to use
* for this project.
* - local_url: The locally installed location of new code to update with.
*
* @return \Symfony\Component\HttpFoundation\Response|null
* The result of processing the batch that updates the projects. If this is
* an instance of \Symfony\Component\HttpFoundation\Response the calling code
* should use that response for the current page request.
*/
function update_authorize_run_update($filetransfer, $projects) {
$operations = [];
foreach ($projects as $project_info) {
$operations[] = [
'update_authorize_batch_copy_project',
[
$project_info['project'],
$project_info['updater_name'],
$project_info['local_url'],
$filetransfer,
],
];
}
$batch = [
'init_message' => t('Preparing to update your site'),
'operations' => $operations,
'finished' => 'update_authorize_update_batch_finished',
'file' => drupal_get_path('module', 'update') . '/update.authorize.inc',
];
batch_set($batch);
// Since authorize.php has its own method for setting the page title, set it
// manually here rather than passing it in to batch_set() as would normally
// be done.
\Drupal::request()->getSession()->set('authorize_page_title', t('Installing updates'));
// Invoke the batch via authorize.php.
return system_authorized_batch_process();
}
/**
* Installs a new project when invoked by authorize.php.
*
* Callback for system_authorized_init() in
* update_manager_install_form_submit().
*
* @param FileTransfer $filetransfer
* The FileTransfer object created by authorize.php for use during this
* operation.
* @param string $project
* The canonical project short name; i.e., the name of the module, theme, or
* profile.
* @param string $updater_name
* The name of the Drupal\Core\Updater\Updater class to use for installing
* this project.
* @param string $local_url
* The URL to the locally installed temp directory where the project has
* already been downloaded and extracted into.
*
* @return \Symfony\Component\HttpFoundation\Response|null
* The result of processing the batch that installs the project. If this is
* an instance of \Symfony\Component\HttpFoundation\Response the calling code
* should use that response for the current page request.
*/
function update_authorize_run_install($filetransfer, $project, $updater_name, $local_url) {
$operations[] = [
'update_authorize_batch_copy_project',
[
$project,
$updater_name,
$local_url,
$filetransfer,
],
];
// @todo Instantiate our Updater to set the human-readable title?
$batch = [
'init_message' => t('Preparing to install'),
'operations' => $operations,
// @todo Use a different finished callback for different messages?
'finished' => 'update_authorize_install_batch_finished',
'file' => drupal_get_path('module', 'update') . '/update.authorize.inc',
];
batch_set($batch);
// Since authorize.php has its own method for setting the page title, set it
// manually here rather than passing it in to batch_set() as would normally
// be done.
\Drupal::request()->getSession()->set('authorize_page_title', t('Installing %project', ['%project' => $project]));
// Invoke the batch via authorize.php.
return system_authorized_batch_process();
}
/**
* Implements callback_batch_operation().
*
* Copies project to its proper place when authorized to do so.
*
* @param string $project
* The canonical short name of the project being installed.
* @param string $updater_name
* The name of the Drupal\Core\Updater\Updater class to use for installing
* this project.
* @param string $local_url
* The URL to the locally installed temp directory where the project has
* already been downloaded and extracted into.
* @param FileTransfer $filetransfer
* The FileTransfer object to use for performing this operation.
* @param array $context
* Reference to an array used for Batch API storage.
*/
function update_authorize_batch_copy_project($project, $updater_name, $local_url, $filetransfer, &$context) {
// Initialize some variables in the Batch API $context array.
if (!isset($context['results']['log'])) {
$context['results']['log'] = [];
}
if (!isset($context['results']['log'][$project])) {
$context['results']['log'][$project] = [];
}
if (!isset($context['results']['tasks'])) {
$context['results']['tasks'] = [];
}
// The batch API uses a session, and since all the arguments are serialized
// and unserialized between requests, although the FileTransfer object itself
// will be reconstructed, the connection pointer itself will be lost. However,
// the FileTransfer object will still have the connection variable, even
// though the connection itself is now gone. So, although it's ugly, we have
// to unset the connection variable at this point so that the FileTransfer
// object will re-initiate the actual connection.
unset($filetransfer->connection);
if (!empty($context['results']['log'][$project]['#abort'])) {
$context['finished'] = 1;
return;
}
$updater = new $updater_name($local_url, \Drupal::getContainer()->get('update.root'));
try {
if ($updater->isInstalled()) {
// This is an update.
$tasks = $updater->update($filetransfer);
}
else {
$tasks = $updater->install($filetransfer);
}
}
catch (UpdaterException $e) {
_update_batch_create_message($context['results']['log'][$project], t('Error installing / updating'), FALSE);
_update_batch_create_message($context['results']['log'][$project], $e->getMessage(), FALSE);
$context['results']['log'][$project]['#abort'] = TRUE;
return;
}
_update_batch_create_message($context['results']['log'][$project], t('Installed %project_name successfully', ['%project_name' => $project]));
if (!empty($tasks)) {
$context['results']['tasks'] += $tasks;
}
// This particular operation is now complete, even though the batch might
// have other operations to perform.
$context['finished'] = 1;
}
/**
* Batch callback: Performs actions when the authorized update batch is done.
*
* This processes the results and stashes them into SESSION such that
* authorize.php will render a report. Also responsible for putting the site
* back online and clearing the update status storage after a successful update.
*
* @param $success
* TRUE if the batch operation was successful; FALSE if there were errors.
* @param $results
* An associative array of results from the batch operation.
*/
function update_authorize_update_batch_finished($success, $results) {
foreach ($results['log'] as $messages) {
if (!empty($messages['#abort'])) {
$success = FALSE;
}
}
$offline = \Drupal::state()->get('system.maintenance_mode');
$session = \Drupal::request()->getSession();
// Unset the variable since it is no longer needed.
$maintenance_mode = $session->remove('maintenance_mode');
if ($success) {
// Now that the update completed, we need to clear the available update data
// and recompute our status, so prevent show bogus results.
_update_authorize_clear_update_status();
// Take the site out of maintenance mode if it was previously that way.
if ($offline && $maintenance_mode === FALSE) {
\Drupal::state()->set('system.maintenance_mode', FALSE);
$page_message = [
'message' => t('Update was completed successfully. Your site has been taken out of maintenance mode.'),
'type' => 'status',
];
}
else {
$page_message = [
'message' => t('Update was completed successfully.'),
'type' => 'status',
];
}
}
elseif (!$offline) {
$page_message = [
'message' => t('Update failed! See the log below for more information.'),
'type' => 'error',
];
}
else {
$page_message = [
'message' => t('Update failed! See the log below for more information. Your site is still in maintenance mode.'),
'type' => 'error',
];
}
// Since we're doing an update of existing code, always add a task for
// running update.php.
$url = Url::fromRoute('system.db_update');
$results['tasks'][] = t('Your modules have been downloaded and updated.');
$results['tasks'][] = [
'#type' => 'link',
'#url' => $url,
'#title' => t('Run database updates'),
// Since this is being called outside of the primary front controller,
// the base_url needs to be set explicitly to ensure that links are
// relative to the site root.
// @todo Simplify with https://www.drupal.org/node/2548095
'#options' => [
'absolute' => TRUE,
'base_url' => $GLOBALS['base_url'],
],
'#access' => $url->access(\Drupal::currentUser()),
];
// Set all these values into the SESSION so authorize.php can display them.
$session->set('authorize_results', [
'success' => $success,
'page_message' => $page_message,
'messages' => $results['log'],
'tasks' => $results['tasks'],
]);
$session->set('authorize_page_title', t('Update manager'));
}
/**
* Implements callback_batch_finished().
*
* Performs actions when the authorized install batch is done.
*
* This processes the results and stashes them into SESSION such that
* authorize.php will render a report. Also responsible for putting the site
* back online after a successful install if necessary.
*
* @param $success
* TRUE if the batch operation was a success; FALSE if there were errors.
* @param $results
* An associative array of results from the batch operation.
*/
function update_authorize_install_batch_finished($success, $results) {
foreach ($results['log'] as $messages) {
if (!empty($messages['#abort'])) {
$success = FALSE;
}
}
$offline = \Drupal::state()->get('system.maintenance_mode');
$session = \Drupal::request()->getSession();
// Unset the variable since it is no longer needed.
$maintenance_mode = $session->remove('maintenance_mode');
if ($success) {
// Take the site out of maintenance mode if it was previously that way.
if ($offline && $maintenance_mode === FALSE) {
\Drupal::state()->set('system.maintenance_mode', FALSE);
$page_message = [
'message' => t('Installation was completed successfully. Your site has been taken out of maintenance mode.'),
'type' => 'status',
];
}
else {
$page_message = [
'message' => t('Installation was completed successfully.'),
'type' => 'status',
];
}
}
elseif (!$success && !$offline) {
$page_message = [
'message' => t('Installation failed! See the log below for more information.'),
'type' => 'error',
];
}
else {
$page_message = [
'message' => t('Installation failed! See the log below for more information. Your site is still in maintenance mode.'),
'type' => 'error',
];
}
// Set all these values into the SESSION so authorize.php can display them.
$session->set('authorize_results', [
'success' => $success,
'page_message' => $page_message,
'messages' => $results['log'],
'tasks' => $results['tasks'],
]);
$session->set('authorize_page_title', t('Update manager'));
}
/**
* Creates a structure of log messages.
*
* @param array $project_results
* An associative array of results from the batch operation.
* @param string $message
* A string containing a log message.
* @param bool $success
* (optional) TRUE if the operation the message is about was a success, FALSE
* if there were errors. Defaults to TRUE.
*/
function _update_batch_create_message(&$project_results, $message, $success = TRUE) {
$project_results[] = ['message' => $message, 'success' => $success];
}
/**
* Clears available update status data.
*
* Since this function is run at such a low bootstrap level, the Update Manager
* module is not loaded. So, we can't just call update_storage_clear(). However,
* the key-value backend is available, so we just call that.
*
* Note that we do not want to delete items related to currently pending fetch
* attempts.
*
* @see update_authorize_update_batch_finished()
* @see update_storage_clear()
*/
function _update_authorize_clear_update_status() {
\Drupal::keyValueExpirable('update')->deleteAll();
\Drupal::keyValueExpirable('update_available_release')->deleteAll();
}
<?php
/**
* @file
* Code required only when comparing available updates to existing data.
*/
use Drupal\update\UpdateFetcherInterface;
use Drupal\update\UpdateManagerInterface;
use Drupal\update\ModuleVersion;
use Drupal\update\ProjectCoreCompatibility;
/**
* Determines version and type information for currently installed projects.
*
* Processes the list of projects on the system to figure out the currently
* installed versions, and other information that is required before we can
* compare against the available releases to produce the status report.
*
* @param $projects
* Array of project information from
* \Drupal\update\UpdateManager::getProjects().
*/
function update_process_project_info(&$projects) {
foreach ($projects as $key => $project) {
// Assume an official release until we see otherwise.
$install_type = 'official';
$info = $project['info'];
if (isset($info['version'])) {
// Check for development snapshots
if (preg_match('@(dev|HEAD)@', $info['version'])) {
$install_type = 'dev';
}
// Figure out what the currently installed major version is. We need
// to handle both contribution (e.g. "5.x-1.3", major = 1) and core
// (e.g. "5.1", major = 5) version strings.
$matches = [];
if (preg_match('/^(\d+\.x-)?(\d+)\..*$/', $info['version'], $matches)) {
$info['major'] = $matches[2];
}
elseif (!isset($info['major'])) {
// This would only happen for version strings that don't follow the
// drupal.org convention. We let contribs define "major" in their
// .info.yml in this case, and only if that's missing would we hit this.
$info['major'] = -1;
}
}
else {
// No version info available at all.
$install_type = 'unknown';
$info['version'] = t('Unknown');
$info['major'] = -1;
}
// Finally, save the results we care about into the $projects array.
$projects[$key]['existing_version'] = $info['version'];
$projects[$key]['existing_major'] = $info['major'];
$projects[$key]['install_type'] = $install_type;
}
}
/**
* Calculates the current update status of all projects on the site.
*
* The results of this function are expensive to compute, especially on sites
* with lots of modules or themes, since it involves a lot of comparisons and
* other operations. Therefore, we store the results. However, since this is not
* the data about available updates fetched from the network, it is ok to
* invalidate it somewhat quickly. If we keep this data for very long, site
* administrators are more likely to see incorrect results if they upgrade to a
* newer version of a module or theme but do not visit certain pages that
* automatically clear this.
*
* @param array $available
* Data about available project releases.
*
* @return
* An array of installed projects with current update status information.
*
* @see update_get_available()
* @see \Drupal\update\UpdateManager::getProjects()
* @see update_process_project_info()
* @see \Drupal\update\UpdateManagerInterface::projectStorage()
* @see \Drupal\update\ProjectCoreCompatibility::setReleaseMessage()
*/
function update_calculate_project_data($available) {
// Retrieve the projects from storage, if present.
$projects = \Drupal::service('update.manager')->projectStorage('update_project_data');
// If $projects is empty, then the data must be rebuilt.
// Otherwise, return the data and skip the rest of the function.
if (!empty($projects)) {
return $projects;
}
$projects = \Drupal::service('update.manager')->getProjects();
update_process_project_info($projects);
if (isset($projects['drupal']) && !empty($available['drupal'])) {
// Calculate core status first so that it is complete before
// \Drupal\update\ProjectCoreCompatibility::setReleaseMessage() is called
// for each module below.
update_calculate_project_update_status($projects['drupal'], $available['drupal']);
if (isset($available['drupal']['releases'])) {
$project_core_compatibility = new ProjectCoreCompatibility($projects['drupal'], $available['drupal']['releases']);
}
}
foreach ($projects as $project => $project_info) {
if (isset($available[$project])) {
if ($project === 'drupal') {
continue;
}
update_calculate_project_update_status($projects[$project], $available[$project]);
// Inject the list of compatible core versions to show administrator(s)
// which versions of core a given available update can be installed with.
// Since individual releases of a project can be compatible with different
// versions of core, and even multiple major versions of core (for
// example, 8.9.x and 9.0.x), this list will hopefully help
// administrator(s) know which available updates they can upgrade a given
// project to.
if (isset($project_core_compatibility)) {
$project_core_compatibility->setReleaseMessage($projects[$project]);
}
}
else {
$projects[$project]['status'] = UpdateFetcherInterface::UNKNOWN;
$projects[$project]['reason'] = t('No available releases found');
}
}
// Give other modules a chance to alter the status (for example, to allow a
// contrib module to provide fine-grained settings to ignore specific
// projects or releases).
\Drupal::moduleHandler()->alter('update_status', $projects);
// Store the site's update status for at most 1 hour.
\Drupal::keyValueExpirable('update')->setWithExpire('update_project_data', $projects, 3600);
return $projects;
}
/**
* Calculates the current update status of a specific project.
*
* This function is the heart of the update status feature. For each project it
* is invoked with, it first checks if the project has been flagged with a
* special status like "unsupported" or "insecure", or if the project node
* itself has been unpublished. In any of those cases, the project is marked
* with an error and the next project is considered.
*
* If the project itself is valid, the function decides what major release
* series to consider. The project defines its currently supported branches in
* its Drupal.org for the project, so the first step is to make sure the
* development branch of the current version is still supported. If so, then the
* major version of the current version is used. If the current version is not
* in a supported branch, the next supported branch is used to determine the
* major version to use. There's also a check to make sure that this function
* never recommends an earlier release than the currently installed major
* version.
*
* Given a target major version, the available releases are scanned looking for
* the specific release to recommend (avoiding beta releases and development
* snapshots if possible). For the target major version, the highest patch level
* is found. If there is a release at that patch level with no extra ("beta",
* etc.), then the release at that patch level with the most recent release date
* is recommended. If every release at that patch level has extra (only betas),
* then the latest release from the previous patch level is recommended. For
* example:
*
* - 1.6-bugfix <-- recommended version because 1.6 already exists.
* - 1.6
*
* or
*
* - 1.6-beta
* - 1.5 <-- recommended version because no 1.6 exists.
* - 1.4
*
* Also, the latest release from the same major version is looked for, even beta
* releases, to display to the user as the "Latest version" option.
* Additionally, the latest official release from any higher major versions that
* have been released is searched for to provide a set of "Also available"
* options.
*
* Finally, and most importantly, the release history continues to be scanned
* until the currently installed release is reached, searching for anything
* marked as a security update. If any security updates have been found between
* the recommended release and the installed version, all of the releases that
* included a security fix are recorded so that the site administrator can be
* warned their site is insecure, and links pointing to the release notes for
* each security update can be included (which, in turn, will link to the
* official security announcements for each vulnerability).
*
* This function relies on the fact that the .xml release history data comes
* sorted based on major version and patch level, then finally by release date
* if there are multiple releases such as betas from the same major.patch
* version (e.g., 5.x-1.5-beta1, 5.x-1.5-beta2, and 5.x-1.5). Development
* snapshots for a given major version are always listed last.
*
* NOTE: This function *must* set a value for $project_data['status'] before
* returning, or the rest of the Update Manager will break in unexpected ways.
*
* @param $project_data
* An array containing information about a specific project.
* @param $available
* Data about available project releases of a specific project.
*/
function update_calculate_project_update_status(&$project_data, $available) {
foreach (['title', 'link'] as $attribute) {
if (!isset($project_data[$attribute]) && isset($available[$attribute])) {
$project_data[$attribute] = $available[$attribute];
}
}
// If the project status is marked as something bad, there's nothing else
// to consider.
if (isset($available['project_status'])) {
switch ($available['project_status']) {
case 'insecure':
$project_data['status'] = UpdateManagerInterface::NOT_SECURE;
if (empty($project_data['extra'])) {
$project_data['extra'] = [];
}
$project_data['extra'][] = [
'label' => t('Project not secure'),
'data' => t('This project has been labeled insecure by the Drupal security team, and is no longer available for download. Immediately disabling everything included by this project is strongly recommended!'),
];
break;
case 'unpublished':
case 'revoked':
$project_data['status'] = UpdateManagerInterface::REVOKED;
if (empty($project_data['extra'])) {
$project_data['extra'] = [];
}
$project_data['extra'][] = [
'label' => t('Project revoked'),
'data' => t('This project has been revoked, and is no longer available for download. Disabling everything included by this project is strongly recommended!'),
];
break;
case 'unsupported':
$project_data['status'] = UpdateManagerInterface::NOT_SUPPORTED;
if (empty($project_data['extra'])) {
$project_data['extra'] = [];
}
$project_data['extra'][] = [
'label' => t('Project not supported'),
'data' => t('This project is no longer supported, and is no longer available for download. Disabling everything included by this project is strongly recommended!'),
];
break;
case 'not-fetched':
$project_data['status'] = UpdateFetcherInterface::NOT_FETCHED;
$project_data['reason'] = t('Failed to get available update data.');
break;
default:
// Assume anything else (e.g. 'published') is valid and we should
// perform the rest of the logic in this function.
break;
}
}
if (!empty($project_data['status'])) {
// We already know the status for this project, so there's nothing else to
// compute. Record the project status into $project_data and we're done.
$project_data['project_status'] = $available['project_status'];
return;
}
// Figure out the target major version.
// Off Drupal.org, '0' could be a valid version string, so don't use empty().
if (!isset($project_data['existing_version']) || $project_data['existing_version'] === '') {
$project_data['status'] = UpdateFetcherInterface::UNKNOWN;
$project_data['reason'] = t('Empty version');
return;
}
try {
$existing_major = ModuleVersion::createFromVersionString($project_data['existing_version'])->getMajorVersion();
}
catch (UnexpectedValueException $exception) {
// If the version has an unexpected value we can't determine updates.
$project_data['status'] = UpdateFetcherInterface::UNKNOWN;
$project_data['reason'] = t('Invalid version: @existing_version', ['@existing_version' => $project_data['existing_version']]);
return;
}
$supported_branches = [];
if (isset($available['supported_branches'])) {
$supported_branches = explode(',', $available['supported_branches']);
}
$is_in_supported_branch = function ($version) use ($supported_branches) {
foreach ($supported_branches as $supported_branch) {
if (strpos($version, $supported_branch) === 0) {
return TRUE;
}
}
return FALSE;
};
if ($is_in_supported_branch($project_data['existing_version'])) {
// Still supported, stay at the current major version.
$target_major = $existing_major;
}
elseif ($supported_branches) {
// We know the current release is unsupported since it is not in
// 'supported_branches' list. We should use the next valid supported
// branch for the target major version.
$project_data['status'] = UpdateManagerInterface::NOT_SUPPORTED;
foreach ($supported_branches as $supported_branch) {
try {
$target_major = ModuleVersion::createFromSupportBranch($supported_branch)->getMajorVersion();
}
catch (UnexpectedValueException $exception) {
continue;
}
}
if (!isset($target_major)) {
// If there are no valid support branches, use the current major.
$target_major = $existing_major;
}
}
else {
// Malformed XML file? Stick with the current branch.
$target_major = $existing_major;
}
// Make sure we never tell the admin to downgrade. If we recommended an
// earlier version than the one they're running, they'd face an
// impossible data migration problem, since Drupal never supports a DB
// downgrade path. In the unfortunate case that what they're running is
// unsupported, and there's nothing newer for them to upgrade to, we
// can't print out a "Recommended version", but just have to tell them
// what they have is unsupported and let them figure it out.
$target_major = max($existing_major, $target_major);
// If the project is marked as UpdateFetcherInterface::FETCH_PENDING, it
// means that the data we currently have (if any) is stale, and we've got a
// task queued up to (re)fetch the data. In that case, we mark it as such,
// merge in whatever data we have (e.g. project title and link), and move on.
if (!empty($available['fetch_status']) && $available['fetch_status'] == UpdateFetcherInterface::FETCH_PENDING) {
$project_data['status'] = UpdateFetcherInterface::FETCH_PENDING;
$project_data['reason'] = t('No available update data');
$project_data['fetch_status'] = $available['fetch_status'];
return;
}
// Defend ourselves from XML history files that contain no releases.
if (empty($available['releases'])) {
$project_data['status'] = UpdateFetcherInterface::UNKNOWN;
$project_data['reason'] = t('No available releases found');
return;
}
$recommended_version_without_extra = '';
$recommended_release = NULL;
foreach ($available['releases'] as $version => $release) {
try {
$release_module_version = ModuleVersion::createFromVersionString($release['version']);
}
catch (UnexpectedValueException $exception) {
continue;
}
// First, if this is the existing release, check a few conditions.
if ($project_data['existing_version'] === $version) {
if (isset($release['terms']['Release type']) &&
in_array('Insecure', $release['terms']['Release type'])) {
$project_data['status'] = UpdateManagerInterface::NOT_SECURE;
}
elseif ($release['status'] == 'unpublished') {
$project_data['status'] = UpdateManagerInterface::REVOKED;
if (empty($project_data['extra'])) {
$project_data['extra'] = [];
}
$project_data['extra'][] = [
'class' => ['release-revoked'],
'label' => t('Release revoked'),
'data' => t('Your currently installed release has been revoked, and is no longer available for download. Disabling everything included in this release or upgrading is strongly recommended!'),
];
}
elseif (isset($release['terms']['Release type']) &&
in_array('Unsupported', $release['terms']['Release type'])) {
$project_data['status'] = UpdateManagerInterface::NOT_SUPPORTED;
if (empty($project_data['extra'])) {
$project_data['extra'] = [];
}
$project_data['extra'][] = [
'class' => ['release-not-supported'],
'label' => t('Release not supported'),
'data' => t('Your currently installed release is now unsupported, and is no longer available for download. Disabling everything included in this release or upgrading is strongly recommended!'),
];
}
}
// Other than the currently installed release, ignore unpublished, insecure,
// or unsupported updates.
elseif ($release['status'] == 'unpublished' ||
!$is_in_supported_branch($release['version']) ||
(isset($release['terms']['Release type']) &&
(in_array('Insecure', $release['terms']['Release type']) ||
in_array('Unsupported', $release['terms']['Release type'])))
) {
continue;
}
$release_major_version = $release_module_version->getMajorVersion();
// See if this is a higher major version than our target and yet still
// supported. If so, record it as an "Also available" release.
if ($release_major_version > $target_major) {
if (!isset($project_data['also'])) {
$project_data['also'] = [];
}
if (!isset($project_data['also'][$release_major_version])) {
$project_data['also'][$release_major_version] = $version;
$project_data['releases'][$version] = $release;
}
// Otherwise, this release can't matter to us, since it's neither
// from the release series we're currently using nor the recommended
// release. We don't even care about security updates for this
// branch, since if a project maintainer puts out a security release
// at a higher major version and not at the lower major version,
// they must remove the lower version from the supported major
// versions at the same time, in which case we won't hit this code.
continue;
}
// Look for the 'latest version' if we haven't found it yet. Latest is
// defined as the most recent version for the target major version.
if (!isset($project_data['latest_version'])
&& $release_major_version == $target_major) {
$project_data['latest_version'] = $version;
$project_data['releases'][$version] = $release;
}
// Look for the development snapshot release for this branch.
if (!isset($project_data['dev_version'])
&& $release_major_version == $target_major
&& $release_module_version->getVersionExtra() === 'dev') {
$project_data['dev_version'] = $version;
$project_data['releases'][$version] = $release;
}
if ($release_module_version->getVersionExtra()) {
$release_version_without_extra = str_replace('-' . $release_module_version->getVersionExtra(), '', $release['version']);
}
else {
$release_version_without_extra = $release['version'];
}
// Look for the 'recommended' version if we haven't found it yet (see
// phpdoc at the top of this function for the definition).
if (!isset($project_data['recommended'])
&& $release_major_version == $target_major) {
if ($recommended_version_without_extra !== $release_version_without_extra) {
$recommended_version_without_extra = $release_version_without_extra;
$recommended_release = $release;
}
if ($release_module_version->getVersionExtra() === NULL) {
$project_data['recommended'] = $recommended_release['version'];
$project_data['releases'][$recommended_release['version']] = $recommended_release;
}
}
// Stop searching once we hit the currently installed version.
if ($project_data['existing_version'] === $version) {
break;
}
// If we're running a dev snapshot and have a timestamp, stop
// searching for security updates once we hit an official release
// older than what we've got. Allow 100 seconds of leeway to handle
// differences between the datestamp in the .info.yml file and the
// timestamp of the tarball itself (which are usually off by 1 or 2
// seconds) so that we don't flag that as a new release.
if ($project_data['install_type'] == 'dev') {
if (empty($project_data['datestamp'])) {
// We don't have current timestamp info, so we can't know.
continue;
}
elseif (isset($release['date']) && ($project_data['datestamp'] + 100 > $release['date'])) {
// We're newer than this, so we can skip it.
continue;
}
}
// See if this release is a security update.
if (isset($release['terms']['Release type'])
&& in_array('Security update', $release['terms']['Release type'])) {
$project_data['security updates'][] = $release;
}
}
// If we were unable to find a recommended version, then make the latest
// version the recommended version if possible.
if (!isset($project_data['recommended']) && isset($project_data['latest_version'])) {
$project_data['recommended'] = $project_data['latest_version'];
}
if (isset($project_data['status'])) {
// If we already know the status, we're done.
return;
}
// If we don't know what to recommend, there's nothing we can report.
// Bail out early.
if (!isset($project_data['recommended'])) {
$project_data['status'] = UpdateFetcherInterface::UNKNOWN;
$project_data['reason'] = t('No available releases found');
return;
}
// If we're running a dev snapshot, compare the date of the dev snapshot
// with the latest official version, and record the absolute latest in
// 'latest_dev' so we can correctly decide if there's a newer release
// than our current snapshot.
if ($project_data['install_type'] == 'dev') {
if (isset($project_data['dev_version']) && $available['releases'][$project_data['dev_version']]['date'] > $available['releases'][$project_data['latest_version']]['date']) {
$project_data['latest_dev'] = $project_data['dev_version'];
}
else {
$project_data['latest_dev'] = $project_data['latest_version'];
}
}
// Figure out the status, based on what we've seen and the install type.
switch ($project_data['install_type']) {
case 'official':
if ($project_data['existing_version'] === $project_data['recommended'] || $project_data['existing_version'] === $project_data['latest_version']) {
$project_data['status'] = UpdateManagerInterface::CURRENT;
}
else {
$project_data['status'] = UpdateManagerInterface::NOT_CURRENT;
}
break;
case 'dev':
$latest = $available['releases'][$project_data['latest_dev']];
if (empty($project_data['datestamp'])) {
$project_data['status'] = UpdateFetcherInterface::NOT_CHECKED;
$project_data['reason'] = t('Unknown release date');
}
elseif (($project_data['datestamp'] + 100 > $latest['date'])) {
$project_data['status'] = UpdateManagerInterface::CURRENT;
}
else {
$project_data['status'] = UpdateManagerInterface::NOT_CURRENT;
}
break;
default:
$project_data['status'] = UpdateFetcherInterface::UNKNOWN;
$project_data['reason'] = t('Invalid info');
}
}
<?php
/**
* @file
* Code required only when fetching information about available updates.
*/
use Drupal\update\UpdateManagerInterface;
/**
* Performs any notifications that should be done once cron fetches new data.
*
* This method checks the status of the site using the new data and, depending
* on the configuration of the site, notifies administrators via email if there
* are new releases or missing security updates.
*
* @see update_requirements()
*/
function _update_cron_notify() {
$update_config = \Drupal::config('update.settings');
module_load_install('update');
$status = update_requirements('runtime');
$params = [];
$notify_all = ($update_config->get('notification.threshold') == 'all');
foreach (['core', 'contrib'] as $report_type) {
$type = 'update_' . $report_type;
if (isset($status[$type]['severity'])
&& ($status[$type]['severity'] == REQUIREMENT_ERROR || ($notify_all && $status[$type]['reason'] == UpdateManagerInterface::NOT_CURRENT))) {
$params[$report_type] = $status[$type]['reason'];
}
}
if (!empty($params)) {
$notify_list = $update_config->get('notification.emails');
if (!empty($notify_list)) {
$default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();
foreach ($notify_list as $target) {
if ($target_user = user_load_by_mail($target)) {
$target_langcode = $target_user->getPreferredLangcode();
}
else {
$target_langcode = $default_langcode;
}
$message = \Drupal::service('plugin.manager.mail')->mail('update', 'status_notify', $target, $target_langcode, $params);
// Track when the last mail was successfully sent to avoid sending
// too many emails.
if ($message['result']) {
\Drupal::state()->set('update.last_email_notification', REQUEST_TIME);
}
}
}
}
}
name: 'Update Manager'
type: module
description: 'Checks for available updates, and can securely install or update modules and themes via a web interface.'
version: VERSION
description: 'Не поддерживается в ДАР CMS'
# version: VERSION
package: Core
core: 8.x
configure: update.settings
# core: 8.x
dependencies:
- drupal:file
<?php
/**
* @file
* Install, update, and uninstall functions for the Update Manager module.
*/
use Drupal\Core\Link;
use Drupal\Core\Url;
use Drupal\update\ProjectSecurityData;
use Drupal\update\ProjectSecurityRequirement;
use Drupal\update\UpdateFetcherInterface;
use Drupal\update\UpdateManagerInterface;
/**
* Implements hook_requirements().
*
* @return
* An array describing the status of the site regarding available updates. If
* there is no update data, only one record will be returned, indicating that
* the status of core can't be determined. If data is available, there will be
* two records: one for core, and another for all of contrib (assuming there
* are any contributed modules or themes enabled on the site). In addition to
* the fields expected by hook_requirements ('value', 'severity', and
* optionally 'description'), this array will contain a 'reason' attribute,
* which is an integer constant to indicate why the given status is being
* returned (UpdateManagerInterface::NOT_SECURE,
* UpdateManagerInterface::NOT_CURRENT, or UpdateManagerInterface::UNKNOWN).
* This is used for generating the appropriate email notification messages
* during update_cron(), and might be useful for other modules that invoke
* update_requirements() to find out if the site is up to date or not.
*
* @see _update_message_text()
* @see _update_cron_notify()
* @see \Drupal\update\UpdateManagerInterface
*/
function update_requirements($phase) {
$requirements = [];
if ($phase == 'runtime') {
if ($available = update_get_available(FALSE)) {
module_load_include('inc', 'update', 'update.compare');
$data = update_calculate_project_data($available);
// First, populate the requirements for core:
$requirements['update_core'] = _update_requirement_check($data['drupal'], 'core');
if (!empty($available['drupal']['releases'])) {
$security_data = ProjectSecurityData::createFromProjectDataAndReleases($data['drupal'], $available['drupal']['releases'])->getCoverageInfo();
if ($core_coverage_requirement = ProjectSecurityRequirement::createFromProjectDataAndSecurityCoverageInfo($data['drupal'], $security_data)->getRequirement()) {
$requirements['coverage_core'] = $core_coverage_requirement;
}
}
// We don't want to check drupal a second time.
unset($data['drupal']);
if (!empty($data)) {
// Now, sort our $data array based on each project's status. The
// status constants are numbered in the right order of precedence, so
// we just need to make sure the projects are sorted in ascending
// order of status, and we can look at the first project we find.
uasort($data, '_update_project_status_sort');
$first_project = reset($data);
$requirements['update_contrib'] = _update_requirement_check($first_project, 'contrib');
}
}
else {
$requirements['update_core']['title'] = t('Drupal core update status');
$requirements['update_core']['value'] = t('No update data available');
$requirements['update_core']['severity'] = REQUIREMENT_WARNING;
$requirements['update_core']['reason'] = UpdateFetcherInterface::UNKNOWN;
$requirements['update_core']['description'] = _update_no_data();
}
}
return $requirements;
}
/**
* Implements hook_install().
*/
function update_install() {
$queue = \Drupal::queue('update_fetch_tasks', TRUE);
$queue->createQueue();
}
/**
* Implements hook_uninstall().
*/
function update_uninstall() {
\Drupal::state()->delete('update.last_check');
\Drupal::state()->delete('update.last_email_notification');
$queue = \Drupal::queue('update_fetch_tasks');
$queue->deleteQueue();
}
/**
* Fills in the requirements array.
*
* This is shared for both core and contrib to generate the right elements in
* the array for hook_requirements().
*
* @param $project
* Array of information about the project we're testing as returned by
* update_calculate_project_data().
* @param $type
* What kind of project this is ('core' or 'contrib').
*
* @return
* An array to be included in the nested $requirements array.
*
* @see hook_requirements()
* @see update_requirements()
* @see update_calculate_project_data()
*/
function _update_requirement_check($project, $type) {
$requirement = [];
if ($type == 'core') {
$requirement['title'] = t('Drupal core update status');
}
else {
$requirement['title'] = t('Module and theme update status');
}
$status = $project['status'];
if ($status != UpdateManagerInterface::CURRENT) {
$requirement['reason'] = $status;
$requirement['severity'] = REQUIREMENT_ERROR;
// When updates are available, append the available updates link to the
// message from _update_message_text(), and format the two translated
// strings together in a single paragraph.
$requirement['description'][] = ['#markup' => _update_message_text($type, $status)];
if (!in_array($status, [UpdateFetcherInterface::UNKNOWN, UpdateFetcherInterface::NOT_CHECKED, UpdateFetcherInterface::NOT_FETCHED, UpdateFetcherInterface::FETCH_PENDING])) {
if (_update_manager_access()) {
$requirement['description'][] = ['#prefix' => ' ', '#markup' => t('See the <a href=":available_updates">available updates</a> page for more information and to install your missing updates.', [':available_updates' => Url::fromRoute('update.report_update')->toString()])];
}
else {
$requirement['description'][] = ['#prefix' => ' ', '#markup' => t('See the <a href=":available_updates">available updates</a> page for more information.', [':available_updates' => Url::fromRoute('update.status')->toString()])];
}
}
}
switch ($status) {
case UpdateManagerInterface::NOT_SECURE:
$requirement_label = t('Not secure!');
break;
case UpdateManagerInterface::REVOKED:
$requirement_label = t('Revoked!');
break;
case UpdateManagerInterface::NOT_SUPPORTED:
$requirement_label = t('Unsupported release');
break;
case UpdateManagerInterface::NOT_CURRENT:
$requirement_label = t('Out of date');
$requirement['severity'] = REQUIREMENT_WARNING;
break;
case UpdateFetcherInterface::UNKNOWN:
case UpdateFetcherInterface::NOT_CHECKED:
case UpdateFetcherInterface::NOT_FETCHED:
case UpdateFetcherInterface::FETCH_PENDING:
$requirement_label = isset($project['reason']) ? $project['reason'] : t('Can not determine status');
$requirement['severity'] = REQUIREMENT_WARNING;
break;
default:
$requirement_label = t('Up to date');
}
if ($status != UpdateManagerInterface::CURRENT && $type == 'core' && isset($project['recommended'])) {
$requirement_label .= ' ' . t('(version @version available)', ['@version' => $project['recommended']]);
}
$requirement['value'] = Link::fromTextAndUrl($requirement_label, Url::fromRoute(_update_manager_access() ? 'update.report_update' : 'update.status'))->toString();
return $requirement;
}
/**
* Rebuild the router to ensure admin/reports/updates/check has CSRF protection.
*/
function update_update_8001() {
// Empty update forces a call to drupal_flush_all_caches() which rebuilds the
// router.
// Use hook_post_update_NAME() instead to clear the cache.The use
// of hook_update_N to clear the cache has been deprecated see
// https://www.drupal.org/node/2960601 for more details.
}
drupal.update.admin:
version: VERSION
css:
theme:
css/update.admin.theme.css: {}
update.report_install:
route_name: update.report_install
title: 'Install new module or theme'
weight: 25
appears_on:
- update.status
update.module_install:
route_name: update.module_install
title: 'Install new module'
weight: 25
appears_on:
- system.modules_list
update.theme_install:
route_name: update.theme_install
title: 'Install new theme'
weight: 25
appears_on:
- system.themes_page
update.status:
title: 'Available updates'
description: 'Get a status report about available updates for your installed modules and themes.'
route_name: update.status
parent: system.admin_reports
weight: -50
update.status:
route_name: update.status
base_route: system.admin_reports
title: List
update.settings:
route_name: update.settings
base_route: system.admin_reports
title: Settings
weight: 50
update.report_update:
route_name: update.report_update
base_route: system.admin_reports
title: Update
weight: 10
update.module_update:
route_name: update.module_update
base_route: system.modules_list
title: Update
weight: 10
update.theme_update:
route_name: update.theme_update
base_route: system.themes_page
title: Update
weight: 10
<?php
/**
* @file
* Administrative screens and processing functions of the Update Manager module.
*
* This allows site administrators with the 'administer software updates'
* permission to either upgrade existing projects, or download and install new
* ones, so long as the killswitch setting ('allow_authorize_operations') is
* not FALSE.
*
* To install new code, the administrator is prompted for either the URL of an
* archive file, or to directly upload the archive file. The archive is loaded
* into a temporary location, extracted, and verified. If everything is
* successful, the user is redirected to authorize.php to type in file transfer
* credentials and authorize the installation to proceed with elevated
* privileges, such that the extracted files can be copied out of the temporary
* location and into the live web root.
*
* Updating existing code is a more elaborate process. The first step is a
* selection form where the user is presented with a table of installed projects
* that are missing newer releases. The user selects which projects they wish to
* update, and presses the "Download updates" button to continue. This sets up a
* batch to fetch all the selected releases, and redirects to
* admin/update/download to display the batch progress bar as it runs. Each
* batch operation is responsible for downloading a single file, extracting the
* archive, and verifying the contents. If there are any errors, the user is
* redirected back to the first page with the error messages. If all downloads
* were extracted and verified, the user is instead redirected to
* admin/update/ready, a landing page which reminds them to backup their
* database and asks if they want to put the site offline during the update.
* Once the user presses the "Install updates" button, they are redirected to
* authorize.php to supply their web root file access credentials. The
* authorized operation (which lives in update.authorize.inc) sets up a batch to
* copy each extracted update from the temporary location into the live web
* root.
*/
use Drupal\Core\Url;
use Drupal\Core\File\Exception\FileException;
use Drupal\Core\File\FileSystemInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
/**
* Batch callback: Performs actions when the download batch is completed.
*
* @param $success
* TRUE if the batch operation was successful, FALSE if there were errors.
* @param $results
* An associative array of results from the batch operation.
*/
function update_manager_download_batch_finished($success, $results) {
if (!empty($results['errors'])) {
$item_list = [
'#theme' => 'item_list',
'#title' => t('Downloading updates failed:'),
'#items' => $results['errors'],
];
\Drupal::messenger()->addError(\Drupal::service('renderer')->render($item_list));
}
elseif ($success) {
\Drupal::messenger()->addStatus(t('Updates downloaded successfully.'));
\Drupal::request()->getSession()->set('update_manager_update_projects', $results['projects']);
return new RedirectResponse(Url::fromRoute('update.confirmation_page', [], ['absolute' => TRUE])->toString());
}
else {
// Ideally we're catching all Exceptions, so they should never see this,
// but just in case, we have to tell them something.
\Drupal::messenger()->addError(t('Fatal error trying to download.'));
}
}
/**
* Checks for file transfer backends and prepares a form fragment about them.
*
* @param array $form
* Reference to the form array we're building.
* @param string $operation
* The update manager operation we're in the middle of. Can be either 'update'
* or 'install'. Use to provide operation-specific interface text.
*
* @return
* TRUE if the update manager should continue to the next step in the
* workflow, or FALSE if we've hit a fatal configuration and must halt the
* workflow.
*/
function _update_manager_check_backends(&$form, $operation) {
// If file transfers will be performed locally, we do not need to display any
// warnings or notices to the user and should automatically continue the
// workflow, since we won't be using a FileTransfer backend that requires
// user input or a specific server configuration.
if (update_manager_local_transfers_allowed()) {
return TRUE;
}
// Otherwise, show the available backends.
$form['available_backends'] = [
'#prefix' => '<p>',
'#suffix' => '</p>',
];
$available_backends = drupal_get_filetransfer_info();
if (empty($available_backends)) {
if ($operation == 'update') {
$form['available_backends']['#markup'] = t('Your server does not support updating modules and themes from this interface. Instead, update modules and themes by uploading the new versions directly to the server, as documented in <a href=":doc_url">Extending Drupal 8</a>.', [':doc_url' => 'https://www.drupal.org/docs/8/extending-drupal-8/overview']);
}
else {
$form['available_backends']['#markup'] = t('Your server does not support installing modules and themes from this interface. Instead, install modules and themes by uploading them directly to the server, as documented in <a href=":doc_url">Extending Drupal 8</a>.', [':doc_url' => 'https://www.drupal.org/docs/8/extending-drupal-8/overview']);
}
return FALSE;
}
$backend_names = [];
foreach ($available_backends as $backend) {
$backend_names[] = $backend['title'];
}
if ($operation == 'update') {
$form['available_backends']['#markup'] = \Drupal::translation()->formatPlural(
count($available_backends),
'Updating modules and themes requires <strong>@backends access</strong> to your server. See <a href=":doc_url">Extending Drupal 8</a> for other update methods.',
'Updating modules and themes requires access to your server via one of the following methods: <strong>@backends</strong>. See <a href=":doc_url">Extending Drupal 8</a> for other update methods.',
[
'@backends' => implode(', ', $backend_names),
':doc_url' => 'https://www.drupal.org/docs/8/extending-drupal-8/overview',
]);
}
else {
$form['available_backends']['#markup'] = \Drupal::translation()->formatPlural(
count($available_backends),
'Installing modules and themes requires <strong>@backends access</strong> to your server. See <a href=":doc_url">Extending Drupal 8</a> for other installation methods.',
'Installing modules and themes requires access to your server via one of the following methods: <strong>@backends</strong>. See <a href=":doc_url">Extending Drupal 8</a> for other installation methods.',
[
'@backends' => implode(', ', $backend_names),
':doc_url' => 'https://www.drupal.org/docs/8/extending-drupal-8/overview',
]);
}
return TRUE;
}
/**
* Unpacks a downloaded archive file.
*
* @param string $file
* The filename of the archive you wish to extract.
* @param string $directory
* The directory you wish to extract the archive into.
*
* @return \Drupal\Core\Archiver\ArchiverInterface
* The Archiver object used to extract the archive.
*
* @throws Exception
*/
function update_manager_archive_extract($file, $directory) {
/** @var \Drupal\Core\Archiver\ArchiverInterface $archiver */
$archiver = \Drupal::service('plugin.manager.archiver')->getInstance([
'filepath' => $file,
]);
if (!$archiver) {
throw new Exception("Cannot extract '$file', not a valid archive");
}
// Remove the directory if it exists, otherwise it might contain a mixture of
// old files mixed with the new files (e.g. in cases where files were removed
// from a later release).
$files = $archiver->listContents();
// Unfortunately, we can only use the directory name to determine the project
// name. Some archivers list the first file as the directory (i.e., MODULE/)
// and others list an actual file (i.e., MODULE/README.TXT).
$project = strtok($files[0], '/\\');
$extract_location = $directory . '/' . $project;
if (file_exists($extract_location)) {
try {
\Drupal::service('file_system')->deleteRecursive($extract_location);
}
catch (FileException $e) {
// Ignore failed deletes.
}
}
$archiver->extract($directory);
return $archiver;
}
/**
* Verifies an archive after it has been downloaded and extracted.
*
* This function is responsible for invoking hook_verify_update_archive().
*
* @param string $project
* The short name of the project to download.
* @param string $archive_file
* The filename of the unextracted archive.
* @param string $directory
* The directory that the archive was extracted into.
*
* @return array
* An array of error messages to display if the archive was invalid. If there
* are no errors, it will be an empty array.
*/
function update_manager_archive_verify($project, $archive_file, $directory) {
return \Drupal::moduleHandler()->invokeAll('verify_update_archive', [$project, $archive_file, $directory]);
}
/**
* Copies a file from the specified URL to the temporary directory for updates.
*
* Returns the local path if the file has already been downloaded.
*
* @param $url
* The URL of the file on the server.
*
* @return string
* Path to local file.
*/
function update_manager_file_get($url) {
$parsed_url = parse_url($url);
$remote_schemes = ['http', 'https', 'ftp', 'ftps', 'smb', 'nfs'];
if (!isset($parsed_url['scheme']) || !in_array($parsed_url['scheme'], $remote_schemes)) {
// This is a local file, just return the path.
return \Drupal::service('file_system')->realpath($url);
}
// Check the cache and download the file if needed.
$cache_directory = _update_manager_cache_directory();
$local = $cache_directory . '/' . \Drupal::service('file_system')->basename($parsed_url['path']);
if (!file_exists($local) || update_delete_file_if_stale($local)) {
return system_retrieve_file($url, $local, FALSE, FileSystemInterface::EXISTS_REPLACE);
}
else {
return $local;
}
}
/**
* Implements callback_batch_operation().
*
* Downloads, unpacks, and verifies a project.
*
* This function assumes that the provided URL points to a file archive of some
* sort. The URL can have any scheme that we have a file stream wrapper to
* support. The file is downloaded to a local cache.
*
* @param string $project
* The short name of the project to download.
* @param string $url
* The URL to download a specific project release archive file.
* @param array $context
* Reference to an array used for Batch API storage.
*
* @see update_manager_download_page()
*/
function update_manager_batch_project_get($project, $url, &$context) {
// This is here to show the user that we are in the process of downloading.
if (!isset($context['sandbox']['started'])) {
$context['sandbox']['started'] = TRUE;
$context['message'] = t('Downloading %project', ['%project' => $project]);
$context['finished'] = 0;
return;
}
// Actually try to download the file.
if (!($local_cache = update_manager_file_get($url))) {
$context['results']['errors'][$project] = t('Failed to download %project from %url', ['%project' => $project, '%url' => $url]);
return;
}
// Extract it.
$extract_directory = _update_manager_extract_directory();
try {
update_manager_archive_extract($local_cache, $extract_directory);
}
catch (Exception $e) {
$context['results']['errors'][$project] = $e->getMessage();
return;
}
// Verify it.
$archive_errors = update_manager_archive_verify($project, $local_cache, $extract_directory);
if (!empty($archive_errors)) {
// We just need to make sure our array keys don't collide, so use the
// numeric keys from the $archive_errors array.
foreach ($archive_errors as $key => $error) {
$context['results']['errors']["$project-$key"] = $error;
}
return;
}
// Yay, success.
$context['results']['projects'][$project] = $url;
$context['finished'] = 1;
}
/**
* Determines if file transfers will be performed locally.
*
* If the server is configured such that webserver-created files have the same
* owner as the configuration directory (e.g., sites/default) where new code
* will eventually be installed, the update manager can transfer files entirely
* locally, without changing their ownership (in other words, without prompting
* the user for FTP, SSH or other credentials).
*
* This server configuration is an inherent security weakness because it allows
* a malicious webserver process to append arbitrary PHP code and then execute
* it. However, it is supported here because it is a common configuration on
* shared hosting, and there is nothing Drupal can do to prevent it.
*
* @return
* TRUE if local file transfers are allowed on this server, or FALSE if not.
*
* @see install_check_requirements()
*/
function update_manager_local_transfers_allowed() {
$file_system = \Drupal::service('file_system');
// Compare the owner of a webserver-created temporary file to the owner of
// the configuration directory to determine if local transfers will be
// allowed.
$temporary_file = \Drupal::service('file_system')->tempnam('temporary://', 'update_');
$site_path = \Drupal::service('site.path');
$local_transfers_allowed = fileowner($temporary_file) === fileowner($site_path);
// Clean up. If this fails, we can ignore it (since this is just a temporary
// file anyway).
@$file_system->unlink($temporary_file);
return $local_transfers_allowed;
}
<?php
/**
* @file
* Handles updates of Drupal core and contributed projects.
*
* The module checks for available updates of Drupal core and any installed
* contributed modules and themes. It warns site administrators if newer
* releases are available via the system status report (admin/reports/status),
* the module and theme pages, and optionally via email. It also provides the
* ability to install contributed modules and themes via an user interface.
*/
use Drupal\Core\File\Exception\FileException;
use Drupal\Core\Link;
use Drupal\Core\Url;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Site\Settings;
use Drupal\update\UpdateFetcherInterface;
use Drupal\update\UpdateManagerInterface;
// These are internally used constants for this code, do not modify.
/**
* Project is missing security update(s).
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0.
* Use \Drupal\update\UpdateManagerInterface::NOT_SECURE instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_NOT_SECURE = 1;
/**
* Current release has been unpublished and is no longer available.
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0.
* Use \Drupal\update\UpdateManagerInterface::REVOKED instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_REVOKED = 2;
/**
* Current release is no longer supported by the project maintainer.
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0.
* Use \Drupal\update\UpdateManagerInterface::NOT_SUPPORTED instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_NOT_SUPPORTED = 3;
/**
* Project has a new release available, but it is not a security release.
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0.
* Use \Drupal\update\UpdateManagerInterface::NOT_CURRENT instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_NOT_CURRENT = 4;
/**
* Project is up to date.
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0.
* Use \Drupal\update\UpdateManagerInterface::CURRENT instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_CURRENT = 5;
/**
* Project's status cannot be checked.
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0.
* Use \Drupal\update\UpdateFetcherInterface::NOT_CHECKED instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_NOT_CHECKED = -1;
/**
* No available update data was found for project.
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0.
* Use \Drupal\update\UpdateFetcherInterface::UNKNOWN instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_UNKNOWN = -2;
/**
* There was a failure fetching available update data for this project.
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0.
* Use \Drupal\update\UpdateFetcherInterface::NOT_FETCHED instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_NOT_FETCHED = -3;
/**
* We need to (re)fetch available update data for this project.
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0.
* Use \Drupal\update\UpdateFetcherInterface::FETCH_PENDING instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_FETCH_PENDING = -4;
/**
* Implements hook_help().
*/
function update_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
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>.', [':update' => 'https://www.drupal.org/documentation/modules/update', ':modules' => Url::fromRoute('system.modules_list')->toString()]) . '</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>';
}
$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>.', [':update-report' => Url::fromRoute('update.status')->toString(), ':update-settings' => Url::fromRoute('update.settings')->toString()]) . '</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>.', [':modules_page' => Url::fromRoute('system.modules_list')->toString(), ':themes_page' => Url::fromRoute('system.themes_page')->toString(), ':update-page' => Url::fromRoute('update.report_update')->toString()]) . '</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.', [':modules_page' => Url::fromRoute('system.modules_list')->toString(), ':themes_page' => Url::fromRoute('system.themes_page')->toString(), ':install' => Url::fromRoute('update.report_install')->toString()]) . '</dd>';
}
$output .= '</dl>';
return $output;
case 'update.status':
return '<p>' . t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') . '</p>';
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.', [':update-php' => Url::fromRoute('system.db_update')->toString(), ':updates' => Url::fromRoute('update.status')->toString()]) . '</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.', [':update-php' => Url::fromRoute('system.db_update')->toString(), ':updates' => Url::fromRoute('update.status')->toString()]) . '</p>';
}
return $output;
}
}
/**
* Implements hook_page_top().
*/
function update_page_top() {
/** @var \Drupal\Core\Routing\AdminContext $admin_context */
$admin_context = \Drupal::service('router.admin_context');
$route_match = \Drupal::routeMatch();
if ($admin_context->isAdminRoute($route_match->getRouteObject()) && \Drupal::currentUser()->hasPermission('administer site configuration')) {
$route_name = \Drupal::routeMatch()->getRouteName();
switch ($route_name) {
// These pages don't need additional nagging.
case 'update.theme_update':
case 'system.theme_install':
case 'update.module_update':
case 'update.module_install':
case 'update.status':
case 'update.report_update':
case 'update.report_install':
case 'update.settings':
case 'system.status':
case 'update.confirmation_page':
return;
// If we are on the appearance or modules list, display a detailed report
// of the update status.
case 'system.themes_page':
case 'system.modules_list':
$verbose = TRUE;
break;
}
module_load_install('update');
$status = update_requirements('runtime');
foreach (['core', 'contrib'] as $report_type) {
$type = 'update_' . $report_type;
// hook_requirements() supports render arrays therefore we need to render
// them before using
// \Drupal\Core\Messenger\MessengerInterface::addStatus().
if (isset($status[$type]['description']) && is_array($status[$type]['description'])) {
$status[$type]['description'] = \Drupal::service('renderer')->renderPlain($status[$type]['description']);
}
if (!empty($verbose)) {
if (isset($status[$type]['severity'])) {
if ($status[$type]['severity'] == REQUIREMENT_ERROR) {
\Drupal::messenger()->addError($status[$type]['description']);
}
elseif ($status[$type]['severity'] == REQUIREMENT_WARNING) {
\Drupal::messenger()->addWarning($status[$type]['description']);
}
}
}
// Otherwise, if we're on *any* admin page and there's a security
// update missing, print an error message about it.
else {
if (isset($status[$type])
&& isset($status[$type]['reason'])
&& $status[$type]['reason'] === UpdateManagerInterface::NOT_SECURE) {
\Drupal::messenger()->addError($status[$type]['description']);
}
}
}
}
}
/**
* Resolves if the current user can access updater menu items.
*
* It both enforces the 'administer software updates' permission and the global
* kill switch for the authorize.php script.
*
* @return
* TRUE if the current user can access the updater menu items; FALSE
* otherwise.
*/
function _update_manager_access() {
return Settings::get('allow_authorize_operations', TRUE) && \Drupal::currentUser()->hasPermission('administer software updates');
}
/**
* Implements hook_theme().
*/
function update_theme() {
return [
'update_last_check' => [
'variables' => ['last' => 0],
],
'update_report' => [
'variables' => ['data' => NULL],
'file' => 'update.report.inc',
],
'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' => [
'variables' => ['version' => NULL, 'title' => NULL, 'attributes' => []],
'file' => 'update.report.inc',
],
];
}
/**
* Implements hook_cron().
*/
function update_cron() {
$update_config = \Drupal::config('update.settings');
$frequency = $update_config->get('check.interval_days');
$interval = 60 * 60 * 24 * $frequency;
$last_check = \Drupal::state()->get('update.last_check') ?: 0;
if ((REQUEST_TIME - $last_check) > $interval) {
// If the configured update interval has elapsed, we want to invalidate
// the data for all projects, attempt to re-fetch, and trigger any
// configured notifications about the new status.
update_refresh();
update_fetch_data();
}
else {
// Otherwise, see if any individual projects are now stale or still
// missing data, and if so, try to fetch the data.
update_get_available(TRUE);
}
$last_email_notice = \Drupal::state()->get('update.last_email_notification') ?: 0;
if ((REQUEST_TIME - $last_email_notice) > $interval) {
// If configured time between notifications elapsed, send email about
// updates possibly available.
module_load_include('inc', 'update', 'update.fetch');
_update_cron_notify();
}
// Clear garbage from disk.
update_clear_update_disk_cache();
}
/**
* Implements hook_themes_installed().
*
* If themes are installed, we invalidate the information of available updates.
*/
function update_themes_installed($themes) {
// Clear all update module data.
update_storage_clear();
}
/**
* Implements hook_themes_uninstalled().
*
* If themes are uninstalled, we invalidate the information of available updates.
*/
function update_themes_uninstalled($themes) {
// Clear all update module data.
update_storage_clear();
}
/**
* Implements hook_form_FORM_ID_alter() for system_modules().
*
* Adds a form submission handler to the system modules form, so that if a site
* admin saves the form, we invalidate the information of available updates.
*
* @see _update_cache_clear()
*/
function update_form_system_modules_alter(&$form, FormStateInterface $form_state) {
$form['#submit'][] = 'update_storage_clear_submit';
}
/**
* Form submission handler for system_modules().
*
* @see update_form_system_modules_alter()
*/
function update_storage_clear_submit($form, FormStateInterface $form_state) {
// Clear all update module data.
update_storage_clear();
}
/**
* Returns a warning message when there is no data about available updates.
*/
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>.', [
':run_cron' => Url::fromRoute('system.run_cron', [], ['query' => $destination])->toString(),
':check_manually' => Url::fromRoute('update.manual_status', [], ['query' => $destination])->toString(),
]);
}
/**
* Tries to get update information and refreshes it when necessary.
*
* In addition to checking the lifetime, this function also ensures that
* there are no .info.yml files for enabled modules or themes that have a newer
* modification timestamp than the last time we checked for available update
* data. If any .info.yml file was modified, it almost certainly means a new
* version of something was installed. Without fresh available update data, the
* logic in update_calculate_project_data() will be wrong and produce confusing,
* bogus results.
*
* @param $refresh
* (optional) Boolean to indicate if this method should refresh automatically
* if there's no data. Defaults to FALSE.
*
* @return
* Array of data about available releases, keyed by project shortname.
*
* @see update_refresh()
* @see \Drupal\update\UpdateManager::getProjects()
*/
function update_get_available($refresh = FALSE) {
module_load_include('inc', 'update', 'update.compare');
$needs_refresh = FALSE;
// Grab whatever data we currently have.
$available = \Drupal::keyValueExpirable('update_available_releases')->getAll();
$projects = \Drupal::service('update.manager')->getProjects();
foreach ($projects as $key => $project) {
// If there's no data at all, we clearly need to fetch some.
if (empty($available[$key])) {
// update_create_fetch_task($project);
\Drupal::service('update.processor')->createFetchTask($project);
$needs_refresh = TRUE;
continue;
}
// See if the .info.yml file is newer than the last time we checked for
// data, and if so, mark this project's data as needing to be re-fetched.
// Any time an admin upgrades their local installation, the .info.yml file
// will be changed, so this is the only way we can be sure we're not showing
// bogus information right after they upgrade.
if ($project['info']['_info_file_ctime'] > $available[$key]['last_fetch']) {
$available[$key]['fetch_status'] = UpdateFetcherInterface::FETCH_PENDING;
}
// If we have project data but no release data, we need to fetch. This
// can be triggered when we fail to contact a release history server.
if (empty($available[$key]['releases']) && !$available[$key]['last_fetch']) {
$available[$key]['fetch_status'] = UpdateFetcherInterface::FETCH_PENDING;
}
// If we think this project needs to fetch, actually create the task now
// and remember that we think we're missing some data.
if (!empty($available[$key]['fetch_status']) && $available[$key]['fetch_status'] == UpdateFetcherInterface::FETCH_PENDING) {
\Drupal::service('update.processor')->createFetchTask($project);
$needs_refresh = TRUE;
}
}
if ($needs_refresh && $refresh) {
// Attempt to drain the queue of fetch tasks.
update_fetch_data();
// After processing the queue, we've (hopefully) got better data, so pull
// the latest data again and use that directly.
$available = \Drupal::keyValueExpirable('update_available_releases')->getAll();
}
return $available;
}
/**
* Identifies equivalent security releases with a hardcoded list.
*
* Generally, only the latest minor version of Drupal 8 is supported. However,
* when security fixes are backported to an old branch, and the site owner
* updates to the release containing the backported fix, they should not
* see "Security update required!" again if the only other security releases
* are releases for the same advisories.
*
* @return string[]
* A list of security release numbers that are equivalent to this release
* (i.e. covered by the same advisory), for backported security fixes only.
*
* @internal
*
* @deprecated in drupal:8.6.0 and is removed from drupal:9.0.0. Use the
* 'Insecure' release type tag in update XML provided by Drupal.org to
* determine if releases are insecure.
*/
function _update_equivalent_security_releases() {
trigger_error("_update_equivalent_security_releases() was a temporary fix and will be removed before 9.0.0. Use the 'Insecure' release type tag in update XML provided by Drupal.org to determine if releases are insecure.", E_USER_DEPRECATED);
switch (\Drupal::VERSION) {
case '8.3.8':
return ['8.4.5', '8.5.0-rc1'];
case '8.3.9':
return ['8.4.6', '8.5.1'];
case '8.4.5':
return ['8.5.0-rc1'];
case '8.4.6':
return ['8.5.1'];
case '8.4.7':
return ['8.5.2'];
case '8.4.8':
return ['8.5.3'];
}
return [];
}
/**
* Adds a task to the queue for fetching release history data for a project.
*
* We only create a new fetch task if there's no task already in the queue for
* this particular project (based on 'update_fetch_task' key-value collection).
*
* @param $project
* Associative array of information about a project as created by
* \Drupal\update\UpdateManager::getProjects(), including keys such as 'name'
* (short name), and the 'info' array with data from a .info.yml file for the
* project.
*
* @see \Drupal\update\UpdateFetcher::createFetchTask()
*/
function update_create_fetch_task($project) {
\Drupal::service('update.processor')->createFetchTask($project);
}
/**
* Refreshes the release data after loading the necessary include file.
*/
function update_refresh() {
\Drupal::service('update.manager')->refreshUpdateData();
}
/**
* Attempts to fetch update data after loading the necessary include file.
*
* @see \Drupal\update\UpdateProcessor::fetchData()
*/
function update_fetch_data() {
\Drupal::service('update.processor')->fetchData();
}
/**
* Batch callback: Performs actions when all fetch tasks have been completed.
*
* @param $success
* TRUE if the batch operation was successful; FALSE if there were errors.
* @param $results
* An associative array of results from the batch operation, including the key
* 'updated' which holds the total number of projects we fetched available
* update data for.
*/
function update_fetch_data_finished($success, $results) {
if ($success) {
if (!empty($results)) {
if (!empty($results['updated'])) {
\Drupal::messenger()->addStatus(\Drupal::translation()->formatPlural($results['updated'], 'Checked available update data for one project.', 'Checked available update data for @count projects.'));
}
if (!empty($results['failures'])) {
\Drupal::messenger()->addError(\Drupal::translation()->formatPlural($results['failures'], 'Failed to get available update data for one project.', 'Failed to get available update data for @count projects.'));
}
}
}
else {
\Drupal::messenger()->addError(t('An error occurred trying to get available update data.'), 'error');
}
}
/**
* Implements hook_mail().
*
* Constructs the email notification message when the site is out of date.
*
* @param $key
* Unique key to indicate what message to build, always 'status_notify'.
* @param $message
* Reference to the message array being built.
* @param $params
* Array of parameters to indicate what kind of text to include in the message
* body. This is a keyed array of message type ('core' or 'contrib') as the
* keys, and the status reason constant (UpdateManagerInterface::NOT_SECURE,
* etc) for the values.
*
* @see \Drupal\Core\Mail\MailManagerInterface::mail()
* @see _update_cron_notify()
* @see _update_message_text()
* @see \Drupal\update\UpdateManagerInterface
*/
function update_mail($key, &$message, $params) {
$langcode = $message['langcode'];
$language = \Drupal::languageManager()->getLanguage($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:', [], ['langcode' => $langcode]) . "\n" . Url::fromRoute('update.status', [], ['absolute' => TRUE, 'language' => $language])->toString();
if (_update_manager_access()) {
$message['body'][] = t('You can automatically install your missing updates using the Update manager:', [], ['langcode' => $langcode]) . "\n" . Url::fromRoute('update.report_update', [], ['absolute' => TRUE, 'language' => $language])->toString();
}
$settings_url = Url::fromRoute('update.settings', [], ['absolute' => TRUE])->toString();
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.', ['@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.', ['@url' => $settings_url]);
}
}
/**
* Returns the appropriate message text when site is out of date or not secure.
*
* These error messages are shared by both update_requirements() for the
* site-wide status report at admin/reports/status and in the body of the
* notification email messages generated by update_cron().
*
* @param $msg_type
* String to indicate what kind of message to generate. Can be either 'core'
* or 'contrib'.
* @param $msg_reason
* Integer constant specifying why message is generated.
* @param $langcode
* (optional) A language code to use. Defaults to NULL.
*
* @return
* The properly translated error message for the given key.
*/
function _update_message_text($msg_type, $msg_reason, $langcode = NULL) {
$text = '';
switch ($msg_reason) {
case UpdateManagerInterface::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!', [], ['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!', [], ['langcode' => $langcode]);
}
break;
case UpdateManagerInterface::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!', [], ['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!', [], ['langcode' => $langcode]);
}
break;
case UpdateManagerInterface::NOT_SUPPORTED:
if ($msg_type == 'core') {
$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.', [], ['langcode' => $langcode]);
}
break;
case UpdateManagerInterface::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.', [], ['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.', [], ['langcode' => $langcode]);
}
break;
case UpdateFetcherInterface::UNKNOWN:
case UpdateFetcherInterface::NOT_CHECKED:
case UpdateFetcherInterface::NOT_FETCHED:
case UpdateFetcherInterface::FETCH_PENDING:
if ($msg_type == 'core') {
$text = t('There was a problem checking <a href=":update-report">available updates</a> for Drupal.', [':update-report' => Url::fromRoute('update.status')->toString()], ['langcode' => $langcode]);
}
else {
$text = t('There was a problem checking <a href=":update-report">available updates</a> for your modules or themes.', [':update-report' => Url::fromRoute('update.status')->toString()], ['langcode' => $langcode]);
}
break;
}
return $text;
}
/**
* Orders projects based on their status.
*
* Callback for uasort() within update_requirements().
*/
function _update_project_status_sort($a, $b) {
// The status constants are numerically in the right order, so we can
// usually subtract the two to compare in the order we want. However,
// negative status values should be treated as if they are huge, since we
// always want them at the bottom of the list.
$a_status = $a['status'] > 0 ? $a['status'] : (-10 * $a['status']);
$b_status = $b['status'] > 0 ? $b['status'] : (-10 * $b['status']);
return $a_status - $b_status;
}
/**
* Prepares variables for last time update data was checked templates.
*
* Default template: update-last-check.html.twig.
*
* In addition to properly formatting the given timestamp, this function also
* provides a "Check manually" link that refreshes the available update and
* redirects back to the same page.
*
* @param $variables
* An associative array containing:
* - last: The timestamp when the site last checked for available updates.
*
* @see theme_update_report()
*/
function template_preprocess_update_last_check(&$variables) {
$variables['time'] = \Drupal::service('date.formatter')->formatTimeDiffSince($variables['last']);
$variables['link'] = Link::fromTextAndUrl(t('Check manually'), Url::fromRoute('update.manual_status', [], ['query' => \Drupal::destination()->getAsArray()]))->toString();
}
/**
* Implements hook_verify_update_archive().
*
* First, we ensure that the archive isn't a copy of Drupal core, which the
* update manager does not yet support. See https://www.drupal.org/node/606592.
*
* Then, we make sure that at least one module included in the archive file has
* an .info.yml file which claims that the code is compatible with the current
* version of Drupal core.
*
* @see \Drupal\Core\Extension\ExtensionDiscovery
*/
function update_verify_update_archive($project, $archive_file, $directory) {
$errors = [];
// Make sure this isn't a tarball of Drupal core.
if (
file_exists("$directory/$project/index.php")
&& file_exists("$directory/$project/core/install.php")
&& file_exists("$directory/$project/core/includes/bootstrap.inc")
&& file_exists("$directory/$project/core/modules/node/node.module")
&& file_exists("$directory/$project/core/modules/system/system.module")
) {
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
// this version of Drupal core. If one is compatible, then the project as a
// whole is considered compatible (since, for example, the project may ship
// with some out-of-date modules that are not necessary for its overall
// functionality).
$compatible_project = FALSE;
$incompatible = [];
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
$files = $file_system->scanDirectory("$directory/$project", '/.*\.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);
// If the module or theme is incompatible with Drupal core, set an error.
if ($info['core_incompatible']) {
$incompatible[] = !empty($info['name']) ? $info['name'] : t('Unknown');
}
else {
$compatible_project = TRUE;
break;
}
}
if (empty($files)) {
$errors[] = t('%archive_file does not contain any .info.yml files.', ['%archive_file' => $file_system->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',
[
'@version' => \Drupal::VERSION,
'%archive_file' => $file_system->basename($archive_file),
'%names' => implode(', ', $incompatible),
]
);
}
return $errors;
}
/**
* Invalidates stored data relating to update status.
*/
function update_storage_clear() {
\Drupal::keyValueExpirable('update')->deleteAll();
\Drupal::keyValueExpirable('update_available_release')->deleteAll();
}
/**
* Returns a short unique identifier for this Drupal installation.
*
* @return
* An eight character string uniquely identifying this Drupal installation.
*/
function _update_manager_unique_identifier() {
$id = &drupal_static(__FUNCTION__, '');
if (empty($id)) {
$id = substr(hash('sha256', Settings::getHashSalt()), 0, 8);
}
return $id;
}
/**
* Returns the directory where update archive files should be extracted.
*
* @param $create
* (optional) Whether to attempt to create the directory if it does not
* already exist. Defaults to TRUE.
*
* @return
* The full path to the temporary directory where update file archives should
* be extracted.
*/
function _update_manager_extract_directory($create = TRUE) {
$directory = &drupal_static(__FUNCTION__, '');
if (empty($directory)) {
$directory = 'temporary://update-extraction-' . _update_manager_unique_identifier();
if ($create && !file_exists($directory)) {
mkdir($directory);
}
}
return $directory;
}
/**
* Returns the directory where update archive files should be cached.
*
* @param $create
* (optional) Whether to attempt to create the directory if it does not
* already exist. Defaults to TRUE.
*
* @return
* The full path to the temporary directory where update file archives should
* be cached.
*/
function _update_manager_cache_directory($create = TRUE) {
$directory = &drupal_static(__FUNCTION__, '');
if (empty($directory)) {
$directory = 'temporary://update-cache-' . _update_manager_unique_identifier();
if ($create && !file_exists($directory)) {
mkdir($directory);
}
}
return $directory;
}
/**
* Clears the temporary files and directories based on file age from disk.
*/
function update_clear_update_disk_cache() {
// List of update module cache directories. Do not create the directories if
// they do not exist.
$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) {
if (is_dir($directory)) {
\Drupal::service('file_system')->scanDirectory($directory, '/.*/', ['callback' => 'update_delete_file_if_stale', 'recurse' => FALSE]);
}
}
}
/**
* Deletes stale files and directories from the update manager disk cache.
*
* Files and directories older than 6 hours and development snapshots older than
* 5 minutes are considered stale. We only cache development snapshots for 5
* minutes since otherwise updated snapshots might not be downloaded as
* expected.
*
* When checking file ages, we need to use the ctime, not the mtime
* (modification time) since many (all?) tar implementations go out of their way
* to set the mtime on the files they create to the timestamps recorded in the
* tarball. We want to see the last time the file was changed on disk, which is
* left alone by tar and correctly set to the time the archive file was
* unpacked.
*
* @param $path
* A string containing a file path or (streamwrapper) URI.
*/
function update_delete_file_if_stale($path) {
if (file_exists($path)) {
$filectime = filectime($path);
$max_age = \Drupal::config('system.file')->get('temporary_maximum_age');
if (REQUEST_TIME - $filectime > $max_age || (preg_match('/.*-dev\.(tar\.gz|zip)/i', $path) && REQUEST_TIME - $filectime > 300)) {
try {
\Drupal::service('file_system')->deleteRecursive($path);
}
catch (FileException $e) {
// Ignore failed deletes.
}
}
}
}
<?php
/**
* @file
* Code required only when rendering the available updates report.
*/
use Drupal\Core\Template\Attribute;
use Drupal\Core\Url;
use Drupal\update\UpdateFetcherInterface;
use Drupal\update\UpdateManagerInterface;
/**
* Prepares variables for project status report templates.
*
* Default template: update-report.html.twig.
*
* @param array $variables
* An associative array containing:
* - data: An array of data about each project's status.
*/
function template_preprocess_update_report(&$variables) {
$data = isset($variables['data']) && is_array($variables['data']) ? $variables['data'] : [];
$last = \Drupal::state()->get('update.last_check') ?: 0;
$variables['last_checked'] = [
'#theme' => 'update_last_check',
'#last' => $last,
// Attach the library to a variable that gets printed always.
'#attached' => [
'library' => [
'update/drupal.update.admin',
],
],
];
// For no project update data, populate no data message.
if (empty($data)) {
$variables['no_updates_message'] = _update_no_data();
}
$rows = [];
foreach ($data as $project) {
$project_status = [
'#theme' => 'update_project_status',
'#project' => $project,
];
// Build project rows.
if (!isset($rows[$project['project_type']])) {
$rows[$project['project_type']] = [
'#type' => 'table',
'#attributes' => ['class' => ['update']],
];
}
$row_key = !empty($project['title']) ? mb_strtolower($project['title']) : mb_strtolower($project['name']);
// Add the project status row and details.
$rows[$project['project_type']][$row_key]['status'] = $project_status;
// Add project status class attribute to the table row.
switch ($project['status']) {
case UpdateManagerInterface::CURRENT:
$rows[$project['project_type']][$row_key]['#attributes'] = ['class' => ['color-success']];
break;
case UpdateFetcherInterface::UNKNOWN:
case UpdateFetcherInterface::FETCH_PENDING:
case UpdateFetcherInterface::NOT_FETCHED:
case UpdateManagerInterface::NOT_SECURE:
case UpdateManagerInterface::REVOKED:
case UpdateManagerInterface::NOT_SUPPORTED:
$rows[$project['project_type']][$row_key]['#attributes'] = ['class' => ['color-error']];
break;
case UpdateFetcherInterface::NOT_CHECKED:
case UpdateManagerInterface::NOT_CURRENT:
default:
$rows[$project['project_type']][$row_key]['#attributes'] = ['class' => ['color-warning']];
break;
}
}
$project_types = [
'core' => t('Drupal core'),
'module' => t('Modules'),
'theme' => t('Themes'),
'module-disabled' => t('Uninstalled modules'),
'theme-disabled' => t('Uninstalled themes'),
];
$variables['project_types'] = [];
foreach ($project_types as $type_name => $type_label) {
if (!empty($rows[$type_name])) {
ksort($rows[$type_name]);
$variables['project_types'][] = [
'label' => $type_label,
'table' => $rows[$type_name],
];
}
}
}
/**
* Prepares variables for update version templates.
*
* Default template: update-version.html.twig.
*
* @param array $variables
* An associative array containing:
* - version: An array of information about the release version.
*/
function template_preprocess_update_version(array &$variables) {
$version = $variables['version'];
if (empty($version['core_compatibility_message'])) {
return;
}
$core_compatible = !empty($version['core_compatible']);
$variables['core_compatibility_details'] = [
'#type' => 'details',
'#title' => $core_compatible ? t('Compatible') : t('Not compatible'),
'#open' => !$core_compatible,
'message' => [
'#markup' => $version['core_compatibility_message'],
],
'#attributes' => [
'class' => [
$core_compatible ? 'compatible' : 'not-compatible',
],
],
];
}
/**
* Prepares variables for update project status templates.
*
* Default template: update-project-status.html.twig.
*
* @param array $variables
* An associative array containing:
* - project: An array of information about the project.
*/
function template_preprocess_update_project_status(&$variables) {
// Storing by reference because we are sorting the project values.
$project = &$variables['project'];
// Set the project title and URL.
$variables['title'] = (isset($project['title'])) ? $project['title'] : $project['name'];
$variables['url'] = (isset($project['link'])) ? Url::fromUri($project['link'])->toString() : NULL;
$variables['install_type'] = $project['install_type'];
if ($project['install_type'] == 'dev' && !empty($project['datestamp'])) {
$variables['datestamp'] = \Drupal::service('date.formatter')->format($project['datestamp'], 'custom', 'Y-M-d');
}
$variables['existing_version'] = $project['existing_version'];
$versions_inner = [];
$security_class = [];
$version_class = [];
if (isset($project['recommended'])) {
if ($project['status'] != UpdateManagerInterface::CURRENT || $project['existing_version'] !== $project['recommended']) {
// First, figure out what to recommend.
// If there's only 1 security update and it has the same version we're
// recommending, give it the same CSS class as if it was recommended,
// but don't print out a separate "Recommended" line for this project.
if (!empty($project['security updates'])
&& count($project['security updates']) == 1
&& $project['security updates'][0]['version'] === $project['recommended']
) {
$security_class[] = 'project-update__version--recommended';
$security_class[] = 'project-update__version---strong';
}
else {
$version_class[] = 'project-update__version--recommended';
// Apply an extra class if we're displaying both a recommended
// version and anything else for an extra visual hint.
if ($project['recommended'] !== $project['latest_version']
|| !empty($project['also'])
|| ($project['install_type'] == 'dev'
&& isset($project['dev_version'])
&& $project['latest_version'] !== $project['dev_version']
&& $project['recommended'] !== $project['dev_version'])
|| (isset($project['security updates'][0])
&& $project['recommended'] !== $project['security updates'][0])
) {
$version_class[] = 'project-update__version--recommended-strong';
}
$versions_inner[] = [
'#theme' => 'update_version',
'#version' => $project['releases'][$project['recommended']],
'#title' => t('Recommended version:'),
'#attributes' => ['class' => $version_class],
];
}
// Now, print any security updates.
if (!empty($project['security updates'])) {
$security_class[] = 'version-security';
foreach ($project['security updates'] as $security_update) {
$versions_inner[] = [
'#theme' => 'update_version',
'#version' => $security_update,
'#title' => t('Security update:'),
'#attributes' => ['class' => $security_class],
];
}
}
}
if ($project['recommended'] !== $project['latest_version']) {
$versions_inner[] = [
'#theme' => 'update_version',
'#version' => $project['releases'][$project['latest_version']],
'#title' => t('Latest version:'),
'#attributes' => ['class' => ['version-latest']],
];
}
if ($project['install_type'] == 'dev'
&& $project['status'] != UpdateManagerInterface::CURRENT
&& isset($project['dev_version'])
&& $project['recommended'] !== $project['dev_version']) {
$versions_inner[] = [
'#theme' => 'update_version',
'#version' => $project['releases'][$project['dev_version']],
'#title' => t('Development version:'),
'#attributes' => ['class' => ['version-latest']],
];
}
}
if (isset($project['also'])) {
foreach ($project['also'] as $also) {
$versions_inner[] = [
'#theme' => 'update_version',
'#version' => $project['releases'][$also],
'#title' => t('Also available:'),
'#attributes' => ['class' => ['version-also-available']],
];
}
}
if (!empty($versions_inner)) {
$variables['versions'] = $versions_inner;
}
if (!empty($project['disabled'])) {
sort($project['disabled']);
$variables['disabled'] = $project['disabled'];
}
sort($project['includes']);
$variables['includes'] = $project['includes'];
$variables['extras'] = [];
if (!empty($project['extra'])) {
foreach ($project['extra'] as $value) {
$extra_item = [];
$extra_item['attributes'] = new Attribute();
$extra_item['label'] = $value['label'];
$extra_item['data'] = [
'#prefix' => '<em>',
'#markup' => $value['data'],
'#suffix' => '</em>',
];
$variables['extras'][] = $extra_item;
}
}
// Set the project status details.
$status_label = NULL;
switch ($project['status']) {
case UpdateManagerInterface::NOT_SECURE:
$status_label = t('Security update required!');
break;
case UpdateManagerInterface::REVOKED:
$status_label = t('Revoked!');
break;
case UpdateManagerInterface::NOT_SUPPORTED:
$status_label = t('Not supported!');
break;
case UpdateManagerInterface::NOT_CURRENT:
$status_label = t('Update available');
break;
case UpdateManagerInterface::CURRENT:
$status_label = t('Up to date');
break;
}
$variables['status']['label'] = $status_label;
$variables['status']['attributes'] = new Attribute();
$variables['status']['reason'] = (isset($project['reason'])) ? $project['reason'] : NULL;
switch ($project['status']) {
case UpdateManagerInterface::CURRENT:
$uri = 'core/misc/icons/73b355/check.svg';
$text = t('Ok');
break;
case UpdateFetcherInterface::UNKNOWN:
case UpdateFetcherInterface::FETCH_PENDING:
case UpdateFetcherInterface::NOT_FETCHED:
$uri = 'core/misc/icons/e29700/warning.svg';
$text = t('Warning');
break;
case UpdateManagerInterface::NOT_SECURE:
case UpdateManagerInterface::REVOKED:
case UpdateManagerInterface::NOT_SUPPORTED:
$uri = 'core/misc/icons/e32700/error.svg';
$text = t('Error');
break;
case UpdateFetcherInterface::NOT_CHECKED:
case UpdateManagerInterface::NOT_CURRENT:
default:
$uri = 'core/misc/icons/e29700/warning.svg';
$text = t('Warning');
break;
}
$variables['status']['icon'] = [
'#theme' => 'image',
'#width' => 18,
'#height' => 18,
'#uri' => $uri,
'#alt' => $text,
'#title' => $text,
];
}
update.settings:
path: '/admin/reports/updates/settings'
defaults:
_form: '\Drupal\update\UpdateSettingsForm'
_title: 'Update Manager settings'
requirements:
_permission: 'administer site configuration'
update.status:
path: '/admin/reports/updates'
defaults:
_controller: '\Drupal\update\Controller\UpdateController::updateStatus'
_title: 'Available updates'
requirements:
_permission: 'administer site configuration'
update.manual_status:
path: '/admin/reports/updates/check'
defaults:
_title: 'Manual update check'
_controller: '\Drupal\update\Controller\UpdateController::updateStatusManually'
requirements:
_permission: 'administer site configuration'
_csrf_token: 'TRUE'
update.report_install:
path: '/admin/reports/updates/install'
defaults:
_form: '\Drupal\update\Form\UpdateManagerInstall'
_title: 'Install'
requirements:
_permission: 'administer software updates'
_access_update_manager: 'TRUE'
update.report_update:
path: '/admin/reports/updates/update'
defaults:
_form: '\Drupal\update\Form\UpdateManagerUpdate'
_title: 'Update'
requirements:
_permission: 'administer software updates'
_access_update_manager: 'TRUE'
update.module_install:
path: '/admin/modules/install'
defaults:
_form: '\Drupal\update\Form\UpdateManagerInstall'
_title: 'Install new module'
requirements:
_permission: 'administer software updates'
_access_update_manager: 'TRUE'
update.module_update:
path: '/admin/modules/update'
defaults:
_form: '\Drupal\update\Form\UpdateManagerUpdate'
_title: 'Update'
requirements:
_permission: 'administer software updates'
_access_update_manager: 'TRUE'
update.theme_install:
path: '/admin/theme/install'
defaults:
_form: '\Drupal\update\Form\UpdateManagerInstall'
_title: 'Install new theme'
requirements:
_permission: 'administer software updates'
_access_update_manager: 'TRUE'
update.theme_update:
path: '/admin/theme/update'
defaults:
_form: '\Drupal\update\Form\UpdateManagerUpdate'
_title: 'Update'
requirements:
_permission: 'administer software updates'
_access_update_manager: 'TRUE'
update.confirmation_page:
path: '/admin/update/ready'
defaults:
_form: '\Drupal\update\Form\UpdateReady'
_title: 'Ready to update'
requirements:
_permission: 'administer software updates'
_access_update_manager: 'TRUE'
services:
access_check.update.manager_access:
class: Drupal\update\Access\UpdateManagerAccessCheck
arguments: ['@settings']
tags:
- { name: access_check, applies_to: _access_update_manager }
update.manager:
class: Drupal\update\UpdateManager
arguments: ['@config.factory', '@module_handler', '@update.processor', '@string_translation', '@keyvalue.expirable', '@theme_handler', '@extension.list.module']
update.processor:
class: Drupal\update\UpdateProcessor
arguments: ['@config.factory', '@queue', '@update.fetcher', '@state', '@private_key', '@keyvalue', '@keyvalue.expirable']
update.fetcher:
class: Drupal\update\UpdateFetcher
arguments: ['@config.factory', '@http_client']
update.root:
class: SplString
factory: update.root.factory:get
tags:
- { name: parameter_service }
update.root.factory:
class: Drupal\update\UpdateRootFactory
arguments: ['@kernel', '@request_stack']
public: false
This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)
Patches applied to this directory:
Remove update module
Source: ./patches/admin_toolbar/remove-update-module.patch
Replace icons
Source: ./patches/admin_toolbar/replace-icons.patch
......
......@@ -454,30 +454,6 @@ class ExtraLinks extends DeriverBase implements ContainerDeriverInterface {
] + $base_plugin_definition;
}
// If module Update Manager is enabled.
if ($this->moduleHandler->moduleExists('update')) {
$links['update.module_install'] = [
'title' => $this->t('Install new module'),
'route_name' => 'update.module_install',
'parent' => 'system.modules_list',
] + $base_plugin_definition;
$links['update.module_update'] = [
'title' => $this->t('Update'),
'route_name' => 'update.module_update',
'parent' => 'system.modules_list',
] + $base_plugin_definition;
$links['update.theme_install'] = [
'title' => $this->t('Install new theme'),
'route_name' => 'update.theme_install',
'parent' => 'system.themes_page',
] + $base_plugin_definition;
$links['update.theme_update'] = [
'title' => $this->t('Update'),
'route_name' => 'update.theme_update',
'parent' => 'system.themes_page',
] + $base_plugin_definition;
}
// If module Devel is enabled.
if ($this->moduleHandler->moduleExists('devel')) {
$links['devel'] = [
......
diff --git a/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php b/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php
index 00ad608..644b6bb 100644
--- a/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php
+++ b/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php
@@ -458,30 +458,6 @@ class ExtraLinks extends DeriverBase implements ContainerDeriverInterface {
] + $base_plugin_definition;
}
- // If module Update Manager is enabled.
- if ($this->moduleHandler->moduleExists('update')) {
- $links['update.module_install'] = [
- 'title' => $this->t('Install new module'),
- 'route_name' => 'update.module_install',
- 'parent' => 'system.modules_list',
- ] + $base_plugin_definition;
- $links['update.module_update'] = [
- 'title' => $this->t('Update'),
- 'route_name' => 'update.module_update',
- 'parent' => 'system.modules_list',
- ] + $base_plugin_definition;
- $links['update.theme_install'] = [
- 'title' => $this->t('Install new theme'),
- 'route_name' => 'update.theme_install',
- 'parent' => 'system.themes_page',
- ] + $base_plugin_definition;
- $links['update.theme_update'] = [
- 'title' => $this->t('Update'),
- 'route_name' => 'update.theme_update',
- 'parent' => 'system.themes_page',
- ] + $base_plugin_definition;
- }
-
// If module Devel is enabled.
if ($this->moduleHandler->moduleExists('devel')) {
$links['devel'] = [
diff --git a/core/modules/update/update.info.yml b/core/modules/update/update.info.yml
index b4536011d2..b2671a94fb 100644
--- a/core/modules/update/update.info.yml
+++ b/core/modules/update/update.info.yml
@@ -1,9 +1,8 @@
name: 'Update Manager'
type: module
-description: 'Checks for available updates, and can securely install or update modules and themes via a web interface.'
-version: VERSION
+description: 'Не поддерживается в ДАР CMS'
+# version: VERSION
package: Core
-core: 8.x
-configure: update.settings
+# core: 8.x
dependencies:
- drupal:file
......@@ -6,8 +6,8 @@ $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
$vendorDir . '/pear/pear_exception',
$vendorDir . '/pear/archive_tar',
$vendorDir . '/pear/console_getopt',
$vendorDir . '/pear/pear-core-minimal/src',
$vendorDir . '/pear/archive_tar',
$vendorDir . '/pear/pear_exception',
);
......@@ -1815,6 +1815,7 @@
}
},
"patches_applied": {
"Remove update module": "./patches/admin_toolbar/remove-update-module.patch",
"Replace icons": "./patches/admin_toolbar/replace-icons.patch"
}
},
......@@ -2693,6 +2694,7 @@
}
},
"patches_applied": {
"Remove update module": "./patches/core/remove-update-module.patch",
"Replace icons": "./patches/core/core-icons.patch"
}
},
......
......@@ -3,7 +3,7 @@
'name' => 'drupal/drupal',
'pretty_version' => '8.9.x-dev',
'version' => '8.9.9999999.9999999-dev',
'reference' => '23bf762765c424fb12e369793a420e654d3f27bb',
'reference' => 'eb3f644a958e69140e4085c7ce1ed2a53f5bb406',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
......@@ -685,7 +685,7 @@
'drupal/drupal' => array(
'pretty_version' => '8.9.x-dev',
'version' => '8.9.9999999.9999999-dev',
'reference' => '23bf762765c424fb12e369793a420e654d3f27bb',
'reference' => 'eb3f644a958e69140e4085c7ce1ed2a53f5bb406',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
......@@ -1504,8 +1504,8 @@
'psr/container-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
1 => '^1.0',
0 => '^1.0',
1 => '1.0',
),
),
'psr/http-message' => array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment