Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drush / drush / src / Boot / Boot.php
1 <?php
2
3 namespace Drush\Boot;
4
5 /**
6  * Defines the interface for a Boot classes.  Any CMS that wishes
7  * to work with Drush should extend BaseBoot.  If the CMS has a
8  * Drupal-Compatibility layer, then it should extend DrupalBoot.
9  *
10  * @todo Doc these methods.
11  */
12 interface Boot
13 {
14     /**
15      * Select the best URI for the provided cwd. Only called
16      * if the user did not explicitly specify a URI.
17      */
18     public function findUri($root, $uri);
19
20     /**
21      * Inject the uri for the specific site to be bootstrapped
22      *
23      * @param string $uri Site to bootstrap
24      */
25     public function setUri($uri);
26
27     /**
28      * This function determines if the specified path points to
29      * the root directory of a CMS that can be bootstrapped by
30      * the specific subclass that implements it.
31      *
32      * These functions should be written such that one and only
33      * one class will return TRUE for any given $path.
34      *
35      * @param $path to a directory to test
36      *
37      * @return TRUE if $path is a valid root directory
38      */
39     public function validRoot($path);
40
41     /**
42      * Given a site root directory, determine the exact version of the software.
43      *
44      * @param string $root
45      *   The full path to the site installation, with no trailing slash.
46      * @return string|NULL
47      *   The version string for the current version of the software, e.g. 8.1.3
48      */
49     public function getVersion($root);
50
51     /**
52      * Returns an array that determines what bootstrap phases
53      * are necessary to bootstrap this CMS.  This array
54      * should map from a numeric phase to the name of a method
55      * (string) in the Boot class that handles the bootstrap
56      * phase.
57      *
58      * @see \Drush\Boot\DrupalBoot::bootstrapPhases()
59      *
60      * @return array of PHASE index => method name.
61      */
62     public function bootstrapPhases();
63
64     /**
65      * Return an array mapping from bootstrap phase shorthand
66      * strings (e.g. "full") to the corresponding bootstrap
67      * phase index constant (e.g. DRUSH_BOOTSTRAP_DRUPAL_FULL).
68      */
69     public function bootstrapPhaseMap();
70
71     /**
72      * Convert from a phase shorthand or constant to a phase index.
73      */
74     public function lookUpPhaseIndex($phase);
75
76     /**
77      * Called by Drush if a command is not found, or if the
78      * command was found, but did not meet requirements.
79      *
80      * The implementation in BaseBoot should be sufficient
81      * for most cases, so this method typically will not need
82      * to be overridden.
83      */
84     public function reportCommandError($command);
85
86     /**
87      * This method is called during the shutdown of drush.
88      *
89      * @return void
90      */
91     public function terminate();
92 }