Theme
class Theme extends Updater implements UpdaterInterface (View source)
Defines a class for updating themes using Drupal\Core\FileTransfer\FileTransfer classes via authorize.php.
Properties
| string | $source | Directory to install from. |
from Updater |
| protected string | $root | The root directory under which new projects will be copied. |
from Updater |
Methods
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.
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.
Returns the directory where a theme should be installed.
Returns the name of the root directory under which projects will be copied.
Checks if the project is installed.
Determines if the Updater can handle the project provided in $directory.
Determines whether this class can update the specified project.
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.
string
getInstallDirectory()
Returns the directory where a theme should be installed.
If the theme is already installed, drupal_get_path() will return a valid path and we should install it there. If we're installing a new theme, we always want it to go into /themes, since that's where all the documentation recommends users install their themes, and there's no way that can conflict on a multi-site installation, since the Update manager won't let you install a new theme if it's already found on your system, and if there was a copy in the top-level we'd see it.
static string
getRootDirectoryRelativePath()
Returns the name of the root directory under which projects will be copied.
bool
isInstalled()
Checks if the project is installed.
static bool
canUpdateDirectory(string $directory)
Determines if the Updater can handle the project provided in $directory.
static bool
canUpdate(string $project_name)
Determines whether this class can update the specified project.