Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Installer / Exception / AlreadyInstalledException.php
1 <?php
2
3 namespace Drupal\Core\Installer\Exception;
4
5 use Drupal\Core\StringTranslation\TranslationInterface;
6
7 /**
8  * Exception thrown if Drupal is installed already.
9  */
10 class AlreadyInstalledException extends InstallerException {
11
12   /**
13    * Constructs a new "already installed" exception.
14    *
15    * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
16    *   The string translation manager.
17    */
18   public function __construct(TranslationInterface $string_translation) {
19     $this->stringTranslation = $string_translation;
20
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>
26 </ul>', [
27       ':base-url' => $GLOBALS['base_url'],
28       ':update-url' => $GLOBALS['base_path'] . 'update.php',
29     ]);
30     parent::__construct($message, $title);
31   }
32
33 }