interface UpdaterInterface (View source)

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.

Methods

bool
isInstalled()

Checks if the project is installed.

static 
getProjectName(string $directory)

Returns the system name of the project.

string
getInstallDirectory()

Returns the path to the default install location for the current project.

static string
getRootDirectoryRelativePath()

Returns the name of the root directory under which projects will be copied.

static bool
canUpdateDirectory(string $directory)

Determines if the Updater can handle the project provided in $directory.

postInstall()

Actions to run after an install has occurred.

postUpdate()

Actions to run after an update has occurred.

Details

bool isInstalled()

Checks if the project is installed.

Return Value

bool

static getProjectName(string $directory)

Returns the system name of the project.

Parameters

string $directory

A directory containing a project.

string getInstallDirectory()

Returns the path to the default install location for the current project.

Return Value

string

An absolute path to the default install location.

static string getRootDirectoryRelativePath()

Returns the name of the root directory under which projects will be copied.

Return Value

string

A relative path to the root directory.

static bool canUpdateDirectory(string $directory)

Determines if the Updater can handle the project provided in $directory.

Parameters

string $directory

The directory.

Return Value

bool

TRUE if the project is installed, FALSE if not.

postInstall()

Actions to run after an install has occurred.

postUpdate()

Actions to run after an update has occurred.