function update_create_fetch_task

Same name in other branches
  1. 7.x modules/update/update.module \update_create_fetch_task()
  2. 9 core/modules/update/update.module \update_create_fetch_task()
  3. 10 core/modules/update/update.module \update_create_fetch_task()
  4. 11.x core/modules/update/update.module \update_create_fetch_task()

Adds a task to the queue for fetching release history data for a project.

We only create a new fetch task if there's no task already in the queue for this particular project (based on 'update_fetch_task' key-value collection).

Parameters

$project: Associative array of information about a project as created by \Drupal\update\UpdateManager::getProjects(), including keys such as 'name' (short name), and the 'info' array with data from a .info.yml file for the project.

See also

\Drupal\update\UpdateFetcher::createFetchTask()

1 call to update_create_fetch_task()
UpdateCoreTest::testFetchTasks in core/modules/update/tests/src/Functional/UpdateCoreTest.php
Tests that exactly one fetch task per project is created and not more.

File

core/modules/update/update.module, line 468

Code

function update_create_fetch_task($project) {
    \Drupal::service('update.processor')->createFetchTask($project);
}

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