Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\Core\Updater;
|
Chris@0
|
4
|
Chris@0
|
5 /**
|
Chris@0
|
6 * Defines an interface for a class which can update a Drupal project.
|
Chris@0
|
7 *
|
Chris@0
|
8 * An Updater currently serves the following purposes:
|
Chris@0
|
9 * - It can take a given directory, and determine if it can operate on it.
|
Chris@0
|
10 * - It can move the contents of that directory into the appropriate place
|
Chris@0
|
11 * on the system using FileTransfer classes.
|
Chris@0
|
12 * - It can return a list of "next steps" after an update or install.
|
Chris@0
|
13 * - In the future, it will most likely perform some of those steps as well.
|
Chris@0
|
14 */
|
Chris@0
|
15 interface UpdaterInterface {
|
Chris@0
|
16
|
Chris@0
|
17 /**
|
Chris@0
|
18 * Checks if the project is installed.
|
Chris@0
|
19 *
|
Chris@0
|
20 * @return bool
|
Chris@0
|
21 */
|
Chris@0
|
22 public function isInstalled();
|
Chris@0
|
23
|
Chris@0
|
24 /**
|
Chris@0
|
25 * Returns the system name of the project.
|
Chris@0
|
26 *
|
Chris@0
|
27 * @param string $directory
|
Chris@0
|
28 * A directory containing a project.
|
Chris@0
|
29 */
|
Chris@0
|
30 public static function getProjectName($directory);
|
Chris@0
|
31
|
Chris@0
|
32 /**
|
Chris@0
|
33 * Returns the path to the default install location for the current project.
|
Chris@0
|
34 *
|
Chris@0
|
35 * @return string
|
Chris@0
|
36 * An absolute path to the default install location.
|
Chris@0
|
37 */
|
Chris@0
|
38 public function getInstallDirectory();
|
Chris@0
|
39
|
Chris@0
|
40 /**
|
Chris@0
|
41 * Returns the name of the root directory under which projects will be copied.
|
Chris@0
|
42 *
|
Chris@0
|
43 * @return string
|
Chris@0
|
44 * A relative path to the root directory.
|
Chris@0
|
45 */
|
Chris@0
|
46 public static function getRootDirectoryRelativePath();
|
Chris@0
|
47
|
Chris@0
|
48 /**
|
Chris@0
|
49 * Determines if the Updater can handle the project provided in $directory.
|
Chris@0
|
50 *
|
Chris@0
|
51 * @param string $directory
|
Chris@0
|
52 *
|
Chris@0
|
53 * @return bool
|
Chris@0
|
54 * TRUE if the project is installed, FALSE if not.
|
Chris@0
|
55 */
|
Chris@0
|
56 public static function canUpdateDirectory($directory);
|
Chris@0
|
57
|
Chris@0
|
58 /**
|
Chris@0
|
59 * Actions to run after an install has occurred.
|
Chris@0
|
60 */
|
Chris@0
|
61 public function postInstall();
|
Chris@0
|
62
|
Chris@0
|
63 /**
|
Chris@0
|
64 * Actions to run after an update has occurred.
|
Chris@0
|
65 */
|
Chris@0
|
66 public function postUpdate();
|
Chris@0
|
67
|
Chris@0
|
68 }
|