interface UpdaterInterface

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Updater/UpdaterInterface.php \Drupal\Core\Updater\UpdaterInterface
  2. 10 core/lib/Drupal/Core/Updater/UpdaterInterface.php \Drupal\Core\Updater\UpdaterInterface
  3. 11.x core/lib/Drupal/Core/Updater/UpdaterInterface.php \Drupal\Core\Updater\UpdaterInterface

Defines an interface for a class which can update a Drupal project.

An Updater currently serves the following purposes:

  • It can take a given directory, and determine if it can operate on it.
  • It can move the contents of that directory into the appropriate place on the system using FileTransfer classes.
  • It can return a list of "next steps" after an update or install.
  • In the future, it will most likely perform some of those steps as well.

Hierarchy

Expanded class hierarchy of UpdaterInterface

All classes that implement UpdaterInterface

File

core/lib/Drupal/Core/Updater/UpdaterInterface.php, line 15

Namespace

Drupal\Core\Updater
View source
interface UpdaterInterface {
    
    /**
     * Checks if the project is installed.
     *
     * @return bool
     */
    public function isInstalled();
    
    /**
     * Returns the system name of the project.
     *
     * @param string $directory
     *   A directory containing a project.
     */
    public static function getProjectName($directory);
    
    /**
     * Returns the path to the default install location for the current project.
     *
     * @return string
     *   An absolute path to the default install location.
     */
    public function getInstallDirectory();
    
    /**
     * Returns the name of the root directory under which projects will be copied.
     *
     * @return string
     *   A relative path to the root directory.
     */
    public static function getRootDirectoryRelativePath();
    
    /**
     * Determines if the Updater can handle the project provided in $directory.
     *
     * @param string $directory
     *   The directory.
     *
     * @return bool
     *   TRUE if the project is installed, FALSE if not.
     */
    public static function canUpdateDirectory($directory);
    
    /**
     * Actions to run after an install has occurred.
     */
    public function postInstall();
    
    /**
     * Actions to run after an update has occurred.
     */
    public function postUpdate();

}

Members

Title Sort descending Modifiers Object type Summary Overrides
UpdaterInterface::canUpdateDirectory public static function Determines if the Updater can handle the project provided in $directory. 2
UpdaterInterface::getInstallDirectory public function Returns the path to the default install location for the current project. 2
UpdaterInterface::getProjectName public static function Returns the system name of the project.
UpdaterInterface::getRootDirectoryRelativePath public static function Returns the name of the root directory under which projects will be copied. 2
UpdaterInterface::isInstalled public function Checks if the project is installed. 2
UpdaterInterface::postInstall public function Actions to run after an install has occurred.
UpdaterInterface::postUpdate public function Actions to run after an update has occurred.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.