Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UpdateDataSubscriber.php

class UpdateDataSubscriber

Clears stale update data once staged changes have been applied.

@internal This is an internal part of Package Manager and may be changed or removed at any time without warning. External code should not interact with this class.

Hierarchy

  • class \Drupal\package_manager\EventSubscriber\UpdateDataSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of UpdateDataSubscriber

File

core/modules/package_manager/src/EventSubscriber/UpdateDataSubscriber.php, line 19

Namespace

Drupal\package_manager\EventSubscriber
View source
final class UpdateDataSubscriber implements EventSubscriberInterface {
    public function __construct(UpdateManagerInterface $updateManager) {
    }
    
    /**
     * Clears stale update data.
     *
     * This will always run after any stage directory changes are applied to the
     * active directory, since it's likely that core and/or multiple extensions
     * have been added, removed, or updated.
     */
    public function clearData() : void {
        $this->updateManager
            ->refreshUpdateData();
        update_storage_clear();
    }
    
    /**
     * {@inheritdoc}
     */
    public static function getSubscribedEvents() : array {
        return [
            PostApplyEvent::class => [
                'clearData',
                1000,
            ],
        ];
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
UpdateDataSubscriber::clearData public function Clears stale update data.
UpdateDataSubscriber::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. Overrides EventSubscriberInterface::getSubscribedEvents
UpdateDataSubscriber::__construct public function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal