class AlreadyInstalledException
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Installer/Exception/AlreadyInstalledException.php \Drupal\Core\Installer\Exception\AlreadyInstalledException
Exception thrown if Drupal is installed already.
Hierarchy
- class \Drupal\Core\Installer\Exception\InstallerException uses \Drupal\Core\StringTranslation\StringTranslationTrait implements \Drupal\Core\Installer\Exception\RuntimeException
- class \Drupal\Core\Installer\Exception\AlreadyInstalledException implements \Drupal\Core\Installer\Exception\InstallerException
Expanded class hierarchy of AlreadyInstalledException
1 file declares its use of AlreadyInstalledException
- install.core.inc in core/
includes/ install.core.inc - API functions for installing Drupal.
File
-
core/
lib/ Drupal/ Core/ Installer/ Exception/ AlreadyInstalledException.php, line 10
Namespace
Drupal\Core\Installer\ExceptionView source
class AlreadyInstalledException extends InstallerException {
/**
* Constructs a new "already installed" exception.
*
* @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
* The string translation manager.
*/
public function __construct(TranslationInterface $string_translation) {
$this->stringTranslation = $string_translation;
$title = $this->t('Drupal already installed');
$replacements = [
':base-url' => $GLOBALS['base_url'],
// We cannot use the route system.db_update here because we are too early
// in the execution stack.
':update-url' => $GLOBALS['base_path'] . 'update.php',
];
$message = $this->t('<ul>
<li>To start over, you must empty your existing database and copy <em>default.settings.php</em> over <em>settings.php</em>.</li>
<li>To upgrade an existing installation, proceed to the <a href=":update-url">update script</a>.</li>
<li>View your <a href=":base-url">existing site</a>.</li>
</ul>', $replacements);
parent::__construct($message, $title);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.