3 namespace Drupal\Core\Installer\Exception;
5 use Drupal\Core\StringTranslation\TranslationInterface;
7 @trigger_error(__NAMESPACE__ . '/InstallProfileMismatchException is deprecated in Drupal 8.6.0 and will be removed before Drupal 9. See https://www.drupal.org/node/2538996', E_USER_DEPRECATED);
10 * Exception thrown if settings.php cannot be written and the chosen profile does not match.
12 class InstallProfileMismatchException extends InstallerException {
15 * Constructs a new InstallProfileMismatchException exception.
17 * @param string $selected_profile
18 * The profile selected by _install_select_profile().
19 * @param string $settings_profile
20 * The profile in settings.php.
21 * @param string $settings_file
22 * The path to settings.php.
23 * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
24 * The string translation manager.
26 * @deprecated in Drupal 8.3.0 and will be removed before Drupal 9.0.0. The
27 * install profile is written to core.extension.
29 * @see _install_select_profile()
30 * @see install_write_profile
32 public function __construct($selected_profile, $settings_profile, $settings_file, TranslationInterface $string_translation) {
33 $this->stringTranslation = $string_translation;
35 $title = $this->t('Install profile mismatch');
37 'The selected profile %profile does not match the install_profile setting, which is %settings_profile. Cannot write updated setting to %settings_file.',
39 '%profile' => $selected_profile,
40 '%settings_profile' => $settings_profile,
41 '%settings_file' => $settings_file,
44 parent::__construct($message, $title);