function UpdateController::updateStatusManually

Same name in other branches
  1. 9 core/modules/update/src/Controller/UpdateController.php \Drupal\update\Controller\UpdateController::updateStatusManually()
  2. 8.9.x core/modules/update/src/Controller/UpdateController.php \Drupal\update\Controller\UpdateController::updateStatusManually()
  3. 11.x core/modules/update/src/Controller/UpdateController.php \Drupal\update\Controller\UpdateController::updateStatusManually()

Manually checks the update status without the use of cron.

1 string reference to 'UpdateController::updateStatusManually'
update.routing.yml in core/modules/update/update.routing.yml
core/modules/update/update.routing.yml

File

core/modules/update/src/Controller/UpdateController.php, line 81

Class

UpdateController
Controller routines for update routes.

Namespace

Drupal\update\Controller

Code

public function updateStatusManually() {
    $this->updateManager
        ->refreshUpdateData();
    $batch_builder = (new BatchBuilder())->setTitle($this->t('Checking available update data'))
        ->addOperation([
        $this->updateManager,
        'fetchDataBatch',
    ], [])
        ->setProgressMessage(t('Trying to check available update data ...'))
        ->setErrorMessage($this->t('Error checking available update data.'))
        ->setFinishCallback('update_fetch_data_finished');
    batch_set($batch_builder->toArray());
    return batch_process('admin/reports/updates');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.