Commit 83d26603 authored by alexpott's avatar alexpott
Browse files

Issue #2474817 by znerol: DrupalKernel::classLoader not updated when switching...

Issue #2474817 by znerol: DrupalKernel::classLoader not updated when switching to apcu either through settings.php or automatically
parent c83565f6
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\TerminableInterface; use Symfony\Component\HttpKernel\TerminableInterface;
use Composer\Autoload\ClassLoader;
use Symfony\Component\Routing\Route; use Symfony\Component\Routing\Route;
/** /**
...@@ -260,6 +259,9 @@ public static function createFromRequest(Request $request, $class_loader, $envir ...@@ -260,6 +259,9 @@ public static function createFromRequest(Request $request, $class_loader, $envir
$class_loader = $apc_loader; $class_loader = $apc_loader;
} }
// Ensure that the class loader reference is up-to-date.
$kernel->classLoader = $class_loader;
return $kernel; return $kernel;
} }
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
namespace Drupal\simpletest; namespace Drupal\simpletest;
use Composer\Autoload\ClassLoader;
use Doctrine\Common\Annotations\SimpleAnnotationReader; use Doctrine\Common\Annotations\SimpleAnnotationReader;
use Doctrine\Common\Reflection\StaticReflectionParser; use Doctrine\Common\Reflection\StaticReflectionParser;
use Drupal\Component\Annotation\Reflection\MockFileFinder; use Drupal\Component\Annotation\Reflection\MockFileFinder;
...@@ -54,12 +53,14 @@ class TestDiscovery { ...@@ -54,12 +53,14 @@ class TestDiscovery {
/** /**
* Constructs a new test discovery. * Constructs a new test discovery.
* *
* @param \Composer\Autoload\ClassLoader $class_loader * @param $class_loader
* The class loader. * The class loader. Normally Composer's ClassLoader, as included by the
* front controller, but may also be decorated; e.g.,
* \Symfony\Component\ClassLoader\ApcClassLoader.
* @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
* (optional) Backend for caching discovery results. * (optional) Backend for caching discovery results.
*/ */
public function __construct(ClassLoader $class_loader, CacheBackendInterface $cache_backend = NULL) { public function __construct($class_loader, CacheBackendInterface $cache_backend = NULL) {
$this->classLoader = $class_loader; $this->classLoader = $class_loader;
$this->cacheBackend = $cache_backend; $this->cacheBackend = $cache_backend;
} }
......
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