More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / core / modules / update / src / UpdateProcessorInterface.php
1 <?php
2
3 namespace Drupal\update;
4
5 /**
6  * Processor of project update information.
7  */
8 interface UpdateProcessorInterface {
9
10   /**
11    * Claims an item in the update fetch queue for processing.
12    *
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.
16    *
17    * @see \Drupal\Core\Queue\QueueInterface::claimItem()
18    */
19   public function claimQueueItem();
20
21   /**
22    * Attempts to drain the queue of tasks for release history data to fetch.
23    */
24   public function fetchData();
25
26   /**
27    * Adds a task to the queue for fetching release history data for a project.
28    *
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
31    * collection).
32    *
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.
38    *
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()
44    */
45   public function createFetchTask($project);
46
47   /**
48    * Processes a task to fetch available update data for a single project.
49    *
50    * Once the release history XML data is downloaded, it is parsed and saved in
51    * an entry just for that project.
52    *
53    * @param array $project
54    *   Associative array of information about the project to fetch data for.
55    *
56    * @return bool
57    *   TRUE if we fetched parsable XML, otherwise FALSE.
58    */
59   public function processFetchTask($project);
60
61   /**
62    * Retrieves the number of items in the update fetch queue.
63    *
64    * @return int
65    *   An integer estimate of the number of items in the queue.
66    *
67    * @see \Drupal\Core\Queue\QueueInterface::numberOfItems()
68    */
69   public function numberOfQueueItems();
70
71   /**
72    * Deletes a finished item from the update fetch queue.
73    *
74    * @param \stdClass $item
75    *   The item returned by \Drupal\Core\Queue\QueueInterface::claimItem().
76    *
77    * @see \Drupal\Core\Queue\QueueInterface::deleteItem()
78    */
79   public function deleteQueueItem($item);
80
81 }