class UpdateRefreshSubscriber in Automatic Updates 8.2
Clears stale update data once a staged update has been committed.
Hierarchy
- class \Drupal\automatic_updates\Event\UpdateRefreshSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of UpdateRefreshSubscriber
1 string reference to 'UpdateRefreshSubscriber'
1 service uses UpdateRefreshSubscriber
File
- src/
Event/ UpdateRefreshSubscriber.php, line 12
Namespace
Drupal\automatic_updates\EventView source
class UpdateRefreshSubscriber implements EventSubscriberInterface {
/**
* The update manager service.
*
* @var \Drupal\update\UpdateManagerInterface
*/
protected $updateManager;
/**
* Constructs an UpdateRefreshSubscriber object.
*
* @param \Drupal\update\UpdateManagerInterface $update_manager
* The update manager service.
*/
public function __construct(UpdateManagerInterface $update_manager) {
$this->updateManager = $update_manager;
}
/**
* Clears stale update data.
*/
public function clearData() : void {
$this->updateManager
->refreshUpdateData();
update_storage_clear();
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
return [
AutomaticUpdatesEvents::POST_COMMIT => [
'clearData',
1000,
],
];
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
UpdateRefreshSubscriber:: |
protected | property | The update manager service. | |
UpdateRefreshSubscriber:: |
public | function | Clears stale update data. | |
UpdateRefreshSubscriber:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
UpdateRefreshSubscriber:: |
public | function | Constructs an UpdateRefreshSubscriber object. |