comparison core/lib/Drupal/Core/Updater/UpdaterInterface.php @ 0:4c8ae668cc8c

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