Patched to Drupal 8.4.8 level. See https://www.drupal.org/sa-core-2018-004 and patch...
[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 /**
8  * Exception thrown if settings.php cannot be written and the chosen profile does not match.
9  */
10 class InstallProfileMismatchException extends InstallerException {
11
12   /**
13    * Constructs a new InstallProfileMismatchException exception.
14    *
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.
23    *
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.
26    *
27    * @see _install_select_profile()
28    * @see install_write_profile
29    */
30   public function __construct($selected_profile, $settings_profile, $settings_file, TranslationInterface $string_translation) {
31     $this->stringTranslation = $string_translation;
32
33     $title = $this->t('Install profile mismatch');
34     $message = $this->t(
35       'The selected profile %profile does not match the install_profile setting, which is %settings_profile. Cannot write updated setting to %settings_file.',
36       [
37         '%profile' => $selected_profile,
38         '%settings_profile' => $settings_profile,
39         '%settings_file' => $settings_file,
40       ]
41     );
42     parent::__construct($message, $title);
43   }
44
45 }