AlreadyInstalledException::__construct

public AlreadyInstalledException::__construct(TranslationInterface $string_translation)

Constructs a new "already installed" exception.

Parameters

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation manager.

Overrides InstallerException::__construct

File

core/lib/Drupal/Core/Installer/Exception/AlreadyInstalledException.php, line 18

Class

AlreadyInstalledException
Exception thrown if Drupal is installed already.

Namespace

Drupal\Core\Installer\Exception

Code

public function __construct(TranslationInterface $string_translation) {
  $this->stringTranslation = $string_translation;

  $title = $this->t('Drupal already installed');
  $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>', array(
    ':base-url' => $GLOBALS['base_url'],
    ':update-url' => $GLOBALS['base_path'] . 'update.php',
  ));
  parent::__construct($message, $title);
}
doc_Drupal
2016-10-29 08:44:23
Comments
Leave a Comment

Please login to continue.