3 namespace Drupal\Core\Installer\Exception;
5 use Drupal\Core\StringTranslation\TranslationInterface;
8 * Exception thrown if Drupal is installed already.
10 class AlreadyInstalledException extends InstallerException {
13 * Constructs a new "already installed" exception.
15 * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
16 * The string translation manager.
18 public function __construct(TranslationInterface $string_translation) {
19 $this->stringTranslation = $string_translation;
21 $title = $this->t('Drupal already installed');
22 $message = $this->t('<ul>
23 <li>To start over, you must empty your existing database and copy <em>default.settings.php</em> over <em>settings.php</em>.</li>
24 <li>To upgrade an existing installation, proceed to the <a href=":update-url">update script</a>.</li>
25 <li>View your <a href=":base-url">existing site</a>.</li>
27 ':base-url' => $GLOBALS['base_url'],
28 ':update-url' => $GLOBALS['base_path'] . 'update.php',
30 parent::__construct($message, $title);