InstallProfileMismatchException.php 1.7 KB

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