You are here

class InstallProfileMismatchException in Drupal 8

Exception thrown if settings.php cannot be written and the chosen profile does not match.

Hierarchy

Expanded class hierarchy of InstallProfileMismatchException

File

core/lib/Drupal/Core/Installer/Exception/InstallProfileMismatchException.php, line 12

Namespace

Drupal\Core\Installer\Exception
View source
class InstallProfileMismatchException extends InstallerException {

  /**
   * Constructs a new InstallProfileMismatchException exception.
   *
   * @param string $selected_profile
   *   The profile selected by _install_select_profile().
   * @param string $settings_profile
   *   The profile in settings.php.
   * @param string $settings_file
   *   The path to settings.php.
   * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
   *   The string translation manager.
   *
   * @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0. The
   *    install profile is written to core.extension.
   *
   * @see _install_select_profile()
   * @see install_write_profile
   */
  public function __construct($selected_profile, $settings_profile, $settings_file, TranslationInterface $string_translation) {
    $this->stringTranslation = $string_translation;
    $title = $this
      ->t('Install profile mismatch');
    $message = $this
      ->t('The selected profile %profile does not match the install_profile setting, which is %settings_profile. Cannot write updated setting to %settings_file.', [
      '%profile' => $selected_profile,
      '%settings_profile' => $settings_profile,
      '%settings_file' => $settings_file,
    ]);
    parent::__construct($message, $title);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
InstallerException::$title protected property The page title to output.
InstallerException::getTitle public function Returns the exception page title.
InstallProfileMismatchException::__construct Deprecated public function Constructs a new InstallProfileMismatchException exception. Overrides InstallerException::__construct
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.