Code owners
Assign users and groups as approvers for specific file changes. Learn more.
automatic_updates.install 1.16 KiB
<?php
/**
* @file
* Contains install and update functions for Automatic Updates.
*/
use Drupal\automatic_updates\Validation\StatusCheckRequirements;
/**
* Implements hook_uninstall().
*/
function automatic_updates_uninstall() {
\Drupal::service('automatic_updates.updater')->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);
return $status_check_requirement->getRequirements();
}
}
/**
* Stores cached readiness check results under a new key.
*/
function automatic_updates_update_9001(): void {
/** @var \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface $key_value */
$key_value = \Drupal::service('keyvalue.expirable')
->get('automatic_updates');
$key_value->rename('readiness_validation_last_run', 'status_check_last_run');
$key_value->rename('readiness_check_timestamp', 'status_check_timestamp');
}