3 namespace Drupal\Core\Updater;
6 * Defines an interface for a class which can update a Drupal project.
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.
15 interface UpdaterInterface {
18 * Checks if the project is installed.
22 public function isInstalled();
25 * Returns the system name of the project.
27 * @param string $directory
28 * A directory containing a project.
30 public static function getProjectName($directory);
33 * Returns the path to the default install location for the current project.
36 * An absolute path to the default install location.
38 public function getInstallDirectory();
41 * Returns the name of the root directory under which projects will be copied.
44 * A relative path to the root directory.
46 public static function getRootDirectoryRelativePath();
49 * Determines if the Updater can handle the project provided in $directory.
51 * @param string $directory
54 * TRUE if the project is installed, FALSE if not.
56 public static function canUpdateDirectory($directory);
59 * Actions to run after an install has occurred.
61 public function postInstall();
64 * Actions to run after an update has occurred.
66 public function postUpdate();