InstallProfileMismatchException.php 1.5 KB

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