3 namespace Drupal\Core\Installer\Exception;
5 use Drupal\Core\StringTranslation\TranslationInterface;
8 * Exception thrown if settings.php cannot be written and the chosen profile does not match.
10 class InstallProfileMismatchException extends InstallerException {
13 * Constructs a new InstallProfileMismatchException exception.
15 * @param string $selected_profile
16 * The profile selected by _install_select_profile().
17 * @param string $settings_profile
18 * The profile in settings.php.
19 * @param string $settings_file
20 * The path to settigns.php.
21 * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
22 * The string translation manager.
24 * @deprecated in Drupal 8.3.0 and will be removed before Drupal 9.0.0. The
25 * install profile is written to core.extension.
27 * @see _install_select_profile()
28 * @see install_write_profile
30 public function __construct($selected_profile, $settings_profile, $settings_file, TranslationInterface $string_translation) {
31 $this->stringTranslation = $string_translation;
33 $title = $this->t('Install profile mismatch');
35 'The selected profile %profile does not match the install_profile setting, which is %settings_profile. Cannot write updated setting to %settings_file.',
37 '%profile' => $selected_profile,
38 '%settings_profile' => $settings_profile,
39 '%settings_file' => $settings_file,
42 parent::__construct($message, $title);