Mercurial > hg > isophonics-drupal-site
annotate core/lib/Drupal/Core/Installer/InstallerKernel.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\Core\Installer; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\Core\DrupalKernel; |
Chris@0 | 6 |
Chris@0 | 7 /** |
Chris@0 | 8 * Extend DrupalKernel to handle force some kernel behaviors. |
Chris@0 | 9 */ |
Chris@0 | 10 class InstallerKernel extends DrupalKernel { |
Chris@0 | 11 |
Chris@0 | 12 /** |
Chris@0 | 13 * {@inheritdoc} |
Chris@0 | 14 */ |
Chris@0 | 15 protected function initializeContainer() { |
Chris@0 | 16 // Always force a container rebuild. |
Chris@0 | 17 $this->containerNeedsRebuild = TRUE; |
Chris@0 | 18 $container = parent::initializeContainer(); |
Chris@0 | 19 return $container; |
Chris@0 | 20 } |
Chris@0 | 21 |
Chris@0 | 22 /** |
Chris@0 | 23 * Reset the bootstrap config storage. |
Chris@0 | 24 * |
Chris@0 | 25 * Use this from a database driver runTasks() if the method overrides the |
Chris@0 | 26 * bootstrap config storage. Normally the bootstrap config storage is not |
Chris@0 | 27 * re-instantiated during a single install request. Most drivers will not |
Chris@0 | 28 * need this method. |
Chris@0 | 29 * |
Chris@0 | 30 * @see \Drupal\Core\Database\Install\Tasks::runTasks() |
Chris@0 | 31 */ |
Chris@0 | 32 public function resetConfigStorage() { |
Chris@0 | 33 $this->configStorage = NULL; |
Chris@0 | 34 } |
Chris@0 | 35 |
Chris@0 | 36 /** |
Chris@0 | 37 * Returns the active configuration storage used during early install. |
Chris@0 | 38 * |
Chris@0 | 39 * This override changes the visibility so that the installer can access |
Chris@0 | 40 * config storage before the container is properly built. |
Chris@0 | 41 * |
Chris@0 | 42 * @return \Drupal\Core\Config\StorageInterface |
Chris@0 | 43 * The config storage. |
Chris@0 | 44 */ |
Chris@0 | 45 public function getConfigStorage() { |
Chris@0 | 46 return parent::getConfigStorage(); |
Chris@0 | 47 } |
Chris@0 | 48 |
Chris@0 | 49 /** |
Chris@0 | 50 * {@inheritdoc} |
Chris@0 | 51 */ |
Chris@0 | 52 public function getInstallProfile() { |
Chris@0 | 53 global $install_state; |
Chris@0 | 54 if ($install_state && empty($install_state['installation_finished'])) { |
Chris@0 | 55 // If the profile has been selected return it. |
Chris@0 | 56 if (isset($install_state['parameters']['profile'])) { |
Chris@0 | 57 $profile = $install_state['parameters']['profile']; |
Chris@0 | 58 } |
Chris@0 | 59 else { |
Chris@0 | 60 $profile = NULL; |
Chris@0 | 61 } |
Chris@0 | 62 } |
Chris@0 | 63 else { |
Chris@0 | 64 $profile = parent::getInstallProfile(); |
Chris@0 | 65 } |
Chris@0 | 66 return $profile; |
Chris@0 | 67 } |
Chris@0 | 68 |
Chris@0 | 69 } |