function Updater::install
Same name in other branches
- 7.x includes/updater.inc \Updater::install()
- 9 core/lib/Drupal/Core/Updater/Updater.php \Drupal\Core\Updater\Updater::install()
- 8.9.x core/lib/Drupal/Core/Updater/Updater.php \Drupal\Core\Updater\Updater::install()
- 10 core/lib/Drupal/Core/Updater/Updater.php \Drupal\Core\Updater\Updater::install()
Installs a Drupal project, returns a list of next actions.
Parameters
\Drupal\Core\FileTransfer\FileTransfer $filetransfer: Object that is a child of FileTransfer.
array $overrides: An array of settings to override defaults; see self::getInstallArgs().
Return value
array An array of links which the user may need to complete the install.
Throws
\Drupal\Core\Updater\UpdaterFileTransferException
File
-
core/
lib/ Drupal/ Core/ Updater/ Updater.php, line 292
Class
- Updater
- Defines the base class for Updaters used in Drupal.
Namespace
Drupal\Core\UpdaterCode
public function install(&$filetransfer, $overrides = []) {
@trigger_error(__METHOD__ . '() is deprecated in drupal:11.1.0 and is removed from drupal:12.0.0. There is no replacement. See https://www.drupal.org/node/3461934', E_USER_DEPRECATED);
try {
// Establish arguments with possible overrides.
$args = $this->getInstallArgs($overrides);
// Make sure the installation parent directory exists and is writable.
$this->prepareInstallDirectory($filetransfer, $args['install_dir']);
// Copy the directory in place.
$filetransfer->copyDirectory($this->source, $args['install_dir']);
// Make sure what we just installed is readable by the web server.
$this->makeWorldReadable($filetransfer, $args['install_dir'] . '/' . $this->name);
// Potentially enable something?
// @todo Decide if we want to implement this.
$this->postInstall();
// For now, just return a list of links of things to do.
return $this->postInstallTasks();
} catch (FileTransferException $e) {
throw new UpdaterFileTransferException("File Transfer failed, reason: '" . strtr($e->getMessage(), $e->arguments) . "'");
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.