3 namespace Drupal\update;
6 * Processor of project update information.
8 interface UpdateProcessorInterface {
11 * Claims an item in the update fetch queue for processing.
13 * @return bool|\stdClass
14 * On success we return an item object. If the queue is unable to claim an
15 * item it returns false.
17 * @see \Drupal\Core\Queue\QueueInterface::claimItem()
19 public function claimQueueItem();
22 * Attempts to drain the queue of tasks for release history data to fetch.
24 public function fetchData();
27 * Adds a task to the queue for fetching release history data for a project.
29 * We only create a new fetch task if there's no task already in the queue for
30 * this particular project (based on 'update_fetch_task' key-value
33 * @param array $project
34 * Associative array of information about a project as created by
35 * \Drupal\Update\UpdateManager::getProjects(), including keys such as
36 * 'name' (short name), and the 'info' array with data from a .info.yml
37 * file for the project.
39 * @see \Drupal\update\UpdateManager::getProjects()
40 * @see update_get_available()
41 * @see \Drupal\update\UpdateManager::refreshUpdateData()
42 * @see \Drupal\update\UpdateProcessor::fetchData()
43 * @see \Drupal\update\UpdateProcessor::processFetchTask()
45 public function createFetchTask($project);
48 * Processes a task to fetch available update data for a single project.
50 * Once the release history XML data is downloaded, it is parsed and saved in
51 * an entry just for that project.
53 * @param array $project
54 * Associative array of information about the project to fetch data for.
57 * TRUE if we fetched parsable XML, otherwise FALSE.
59 public function processFetchTask($project);
62 * Retrieves the number of items in the update fetch queue.
65 * An integer estimate of the number of items in the queue.
67 * @see \Drupal\Core\Queue\QueueInterface::numberOfItems()
69 public function numberOfQueueItems();
72 * Deletes a finished item from the update fetch queue.
74 * @param \stdClass $item
75 * The item returned by \Drupal\Core\Queue\QueueInterface::claimItem().
77 * @see \Drupal\Core\Queue\QueueInterface::deleteItem()
79 public function deleteQueueItem($item);