UpdateProcessor::createFetchTask

public UpdateProcessor::createFetchTask($project)

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

array $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.

Overrides UpdateProcessorInterface::createFetchTask

See also

\Drupal\update\UpdateManager::getProjects()

update_get_available()

\Drupal\update\UpdateManager::refreshUpdateData()

\Drupal\update\UpdateProcessor::fetchData()

\Drupal\update\UpdateProcessor::processFetchTask()

File

core/modules/update/src/UpdateProcessor.php, line 114

Class

UpdateProcessor
Process project update information.

Namespace

Drupal\update

Code

public function createFetchTask($project) {
  if (empty($this->fetchTasks)) {
    $this->fetchTasks = $this->fetchTaskStore->getAll();
  }
  if (empty($this->fetchTasks[$project['name']])) {
    $this->fetchQueue->createItem($project);
    $this->fetchTaskStore->set($project['name'], $project);
    $this->fetchTasks[$project['name']] = REQUEST_TIME;
  }
}
doc_Drupal
2016-10-29 09:50:59
Comments
Leave a Comment

Please login to continue.