Skip to content
Snippets Groups Projects
Commit 600a17e8 authored by Katherine Bailey's avatar Katherine Bailey
Browse files

Make installation work

parent 8b2e986c
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
use Symfony\Component\ClassLoader\ApcUniversalClassLoader;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Language\Language;
......@@ -2459,14 +2460,39 @@ function drupal_container(Container $reset = NULL) {
$container = $reset;
}
elseif (!isset($container)) {
// This will only ever happen if an error has been thrown. Just build a new
// ContainerBuilder with only the language_interface service.
// During a normal page request, as opposed to during installation, this will only
// ever happen if an error has been thrown. We need to build a new ContainerBuilder
// with only the language_interface service.
$container = new ContainerBuilder();
// An interface language always needs to be available for t() and other
// functions. This default is overridden by drupal_language_initialize()
// during language negotiation.
$container->register(LANGUAGE_TYPE_INTERFACE, 'Drupal\\Core\\Language\\Language');
// If we are at the beginning of the installation process, we also need the config
// services.
if (variable_get('install_task', '') != 'done') {
// Register configuration storage dispatcher.
$container->setParameter('config.storage.info', array(
'Drupal\Core\Config\DatabaseStorage' => array(
'connection' => 'default',
'target' => 'default',
'read' => TRUE,
'write' => TRUE,
),
'Drupal\Core\Config\FileStorage' => array(
'directory' => config_get_config_directory(),
'read' => TRUE,
'write' => FALSE,
),
));
$container->register('config.storage.dispatcher', 'Drupal\Core\Config\StorageDispatcher')
->addArgument('%config.storage.info%');
// Register configuration object factory.
$container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
->addArgument(new Reference('config.storage.dispatcher'));
}
}
return $container;
}
......
<?php
use Drupal\Core\DrupalKernel;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Install\TaskException;
......@@ -1416,6 +1417,8 @@ function install_bootstrap_full(&$install_state) {
// Clear the module list that was overriden earlier in the process.
// This will allow all freshly installed modules to be loaded.
module_list_reset();
$kernel = new DrupalKernel('prod', FALSE);
$kernel->boot();
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment