Commit 7019a0c1 authored by effulgentsia's avatar effulgentsia Committed by effulgentsia

Ensure router.builder and other services are available during upgrade.

This is mostly temporary measures to work around bootstrap circular
dependencies until those are fixed.
parent 6779c079
......@@ -10,6 +10,7 @@
use Drupal\Core\Database\Database;
use Drupal\simpletest\WebTestBase;
use Exception;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
/**
* Perform end-to-end tests of the upgrade path.
......@@ -246,7 +247,14 @@ protected function performUpgrade($register_errors = TRUE) {
module_load_all(FALSE, TRUE);
// Rebuild caches.
drupal_flush_all_caches();
// @todo Remove the try/catch when UpgradePathTestBase::setup() is fixed to
// boot DrupalKernel (as WebTestBase::setup() does).
drupal_static_reset();
try {
drupal_flush_all_caches();
}
catch (InvalidArgumentException $e) {
}
// Reload global $conf array and permissions.
$this->refreshVariables();
......
......@@ -16,6 +16,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\DependencyInjection\Reference;
// Change the directory to the Drupal root.
chdir('..');
......@@ -445,6 +446,17 @@ function update_check_requirements($skip_warnings = FALSE) {
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_maintenance_theme();
// @todo Remove after converting update.php to use DrupalKernel.
$container = drupal_container();
$container->register('database', 'Drupal\Core\Database\Connection')
->setFactoryClass('Drupal\Core\Database\Database')
->setFactoryMethod('getConnection')
->addArgument('default');
$container->register('router.dumper', '\Drupal\Core\Routing\MatcherDumper')
->addArgument(new Reference('database'));
$container->register('router.builder', 'Drupal\Core\Routing\RouteBuilder')
->addArgument(new Reference('router.dumper'));
// Turn error reporting back on. From now on, only fatal errors (which are
// not passed through the error handler) will cause a message to be printed.
ini_set('display_errors', TRUE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment