Forked from
project / automatic_updates
160 commits behind the upstream repository.
-
Issue #3326486 by kunal.sachdev, phenaproxima, Wim Leers, tedbow, yash.rode: Rename Stage to StageBase to clarify its relationship to its subclasses, and add "Stage" suffix to the Updater classes
Issue #3326486 by kunal.sachdev, phenaproxima, Wim Leers, tedbow, yash.rode: Rename Stage to StageBase to clarify its relationship to its subclasses, and add "Stage" suffix to the Updater classes
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
automatic_updates.install 1.64 KiB
<?php
/**
* @file
* Contains install and update functions for Automatic Updates.
*/
declare(strict_types = 1);
use Drupal\automatic_updates\CronUpdateStage;
use Drupal\automatic_updates\Validation\StatusCheckRequirements;
use Drupal\system\SystemManager;
/**
* Implements hook_uninstall().
*/
function automatic_updates_uninstall() {
\Drupal::service('automatic_updates.update_stage')->destroy(TRUE);
}
/**
* Implements hook_requirements().
*/
function automatic_updates_requirements($phase) {
if ($phase === 'runtime') {
// Check that site is ready to perform automatic updates.
/** @var \Drupal\automatic_updates\Validation\StatusCheckRequirements $status_check_requirement */
$status_check_requirement = \Drupal::classResolver(StatusCheckRequirements::class);
$requirements = $status_check_requirement->getRequirements();
// Check that site has cron updates enabled or not.
// @todo Remove in https://www.drupal.org/project/automatic_updates/issues/3284443
if (\Drupal::configFactory()->get('automatic_updates.settings')->get('cron') !== CronUpdateStage::DISABLED) {
$requirements['automatic_updates_cron'] = [
'title' => t('Cron installs updates automatically'),
'severity' => SystemManager::REQUIREMENT_WARNING,
'value' => t('Enabled. This is NOT an officially supported feature of the Automatic Updates module at this time. Use at your own risk.'),
];
}
return $requirements;
}
}
// BEGIN: DELETE FROM CORE MERGE REQUEST
/**
* Implements hook_update_last_removed().
*/
function automatic_updates_update_last_removed(): int {
return 9002;
}
// END: DELETE FROM CORE MERGE REQUEST