Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Installer / Exception / InstallProfileMismatchException.php
1 <?php
2
3 namespace Drupal\Core\Installer\Exception;
4
5 use Drupal\Core\StringTranslation\TranslationInterface;
6
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);
8
9 /**
10  * Exception thrown if settings.php cannot be written and the chosen profile does not match.
11  */
12 class InstallProfileMismatchException extends InstallerException {
13
14   /**
15    * Constructs a new InstallProfileMismatchException exception.
16    *
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.
25    *
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.
28    *
29    * @see _install_select_profile()
30    * @see install_write_profile
31    */
32   public function __construct($selected_profile, $settings_profile, $settings_file, TranslationInterface $string_translation) {
33     $this->stringTranslation = $string_translation;
34
35     $title = $this->t('Install profile mismatch');
36     $message = $this->t(
37       'The selected profile %profile does not match the install_profile setting, which is %settings_profile. Cannot write updated setting to %settings_file.',
38       [
39         '%profile' => $selected_profile,
40         '%settings_profile' => $settings_profile,
41         '%settings_file' => $settings_file,
42       ]
43     );
44     parent::__construct($message, $title);
45   }
46
47 }