Updater
class Updater (View source)
Defines the base class for Updaters used in Drupal.
Properties
| string | $source | Directory to install from. |
|
| protected string | $root | The root directory under which new projects will be copied. |
Methods
Constructs a new updater.
Returns an Updater of the appropriate type depending on the source.
Determines which Updater class can operate on the given directory.
Determines what the most important (or only) info file is in a directory.
Get Extension information from directory.
Gets the name of the project directory (basename).
Returns the project name from a Drupal info file.
Stores the default parameters for the Updater.
Updates a Drupal project and returns a list of next actions.
Installs a Drupal project, returns a list of next actions.
Makes sure the installation parent directory exists and is writable.
Ensures that a given directory is world readable.
Returns the full path to a directory where backups should be written.
Performs actions after new code is updated.
Performs actions after installation.
Returns an array of links to pages that should be visited post operation.
Returns an array of links to pages that should be visited post operation.
Details
__construct(string $source, string $root)
Constructs a new updater.
static Updater
factory(string $source, string $root)
Returns an Updater of the appropriate type depending on the source.
If a directory is provided which contains a module, will return a ModuleUpdater.
static string
getUpdaterFromDirectory(string $directory)
Determines which Updater class can operate on the given directory.
static string
findInfoFile(string $directory)
Determines what the most important (or only) info file is in a directory.
Since there is no enforcement of which info file is the project's "main" info file, this will get one with the same name as the directory, or the first one it finds. Not ideal, but needs a larger solution.
static protected array
getExtensionInfo(string $directory)
Get Extension information from directory.
static string
getProjectName(string $directory)
Gets the name of the project directory (basename).
static string
getProjectTitle(string $directory)
Returns the project name from a Drupal info file.
protected array
getInstallArgs(array $overrides = [])
Stores the default parameters for the Updater.
array
update(FileTransfer $filetransfer, array $overrides = [])
Updates a Drupal project and returns a list of next actions.
array
install(FileTransfer $filetransfer, array $overrides = [])
Installs a Drupal project, returns a list of next actions.
prepareInstallDirectory(FileTransfer $filetransfer, string $directory)
Makes sure the installation parent directory exists and is writable.
makeWorldReadable(FileTransfer $filetransfer, string $path, bool $recursive = TRUE)
Ensures that a given directory is world readable.
makeBackup(FileTransfer $filetransfer, string $from, string $to)
Performs a backup.
getBackupDir()
Returns the full path to a directory where backups should be written.
postUpdate()
Performs actions after new code is updated.
postInstall()
Performs actions after installation.
array
postInstallTasks()
Returns an array of links to pages that should be visited post operation.
array
postUpdateTasks()
Returns an array of links to pages that should be visited post operation.