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