3 namespace Drupal\update;
7 * Processor of project update information.
9 interface UpdateProcessorInterface {
12 * Claims an item in the update fetch queue for processing.
14 * @return bool|\stdClass
15 * On success we return an item object. If the queue is unable to claim an
16 * item it returns false.
18 * @see \Drupal\Core\Queue\QueueInterface::claimItem()
20 public function claimQueueItem();
23 * Attempts to drain the queue of tasks for release history data to fetch.
25 public function fetchData();
28 * Adds a task to the queue for fetching release history data for a project.
30 * We only create a new fetch task if there's no task already in the queue for
31 * this particular project (based on 'update_fetch_task' key-value
34 * @param array $project
35 * Associative array of information about a project as created by
36 * \Drupal\Update\UpdateManager::getProjects(), including keys such as
37 * 'name' (short name), and the 'info' array with data from a .info.yml
38 * file for the project.
40 * @see \Drupal\update\UpdateManager::getProjects()
41 * @see update_get_available()
42 * @see \Drupal\update\UpdateManager::refreshUpdateData()
43 * @see \Drupal\update\UpdateProcessor::fetchData()
44 * @see \Drupal\update\UpdateProcessor::processFetchTask()
46 public function createFetchTask($project);
49 * Processes a task to fetch available update data for a single project.
51 * Once the release history XML data is downloaded, it is parsed and saved in
52 * an entry just for that project.
54 * @param array $project
55 * Associative array of information about the project to fetch data for.
58 * TRUE if we fetched parsable XML, otherwise FALSE.
60 public function processFetchTask($project);
63 * Retrieves the number of items in the update fetch queue.
66 * An integer estimate of the number of items in the queue.
68 * @see \Drupal\Core\Queue\QueueInterface::numberOfItems()
70 public function numberOfQueueItems();
73 * Deletes a finished item from the update fetch queue.
75 * @param \stdClass $item
76 * The item returned by \Drupal\Core\Queue\QueueInterface::claimItem().
78 * @see \Drupal\Core\Queue\QueueInterface::deleteItem()
80 public function deleteQueueItem($item);