From 0b29221849af12bfc4cdde541858cfa9f778bacf Mon Sep 17 00:00:00 2001 From: Katherine Bailey Date: Sat, 28 Jul 2012 21:12:19 -0700 Subject: [PATCH] Addressing some documentation and code style issues --- core/includes/path.inc | 9 +++++++-- .../Compiler/RegisterKernelListenersPass.php | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/includes/path.inc b/core/includes/path.inc index 3eb57fb7eee..67fc5d94e1c 100644 --- a/core/includes/path.inc +++ b/core/includes/path.inc @@ -218,8 +218,11 @@ function drupal_cache_system_paths() { // after we have left the scope of the Request, the call to current_path() // here does not return the system path, and instead calls out to // _current_path(), which returns the alias. So the alias gets used as the - // key instead. There is a separate issue for fixing up the path alias logic - // here: http://drupal.org/node/1269742 + // key instead. At lookup time, whether the alias or the source is used as + // the key depends on when the first call to url() is made for that path. + // If this is within the request scope, it uses the system_path and so will + // be a cache miss. There is a separate issue for fixing up the path alias + // logic here: http://drupal.org/node/1269742 // Generate a cache ID (cid) specifically for this page. $cid = current_path(); @@ -369,6 +372,8 @@ function current_path() { if (drupal_container()->has('request')) { return drupal_container()->get('request')->attributes->get('system_path'); } + // If we are outside the request scope, e.g. during $kernel->terminate, fall + // back to using the path stored in _current_path(). return _current_path(); } diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterKernelListenersPass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterKernelListenersPass.php index 55343dc3b00..5b1a9aba896 100644 --- a/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterKernelListenersPass.php +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterKernelListenersPass.php @@ -7,6 +7,7 @@ namespace Drupal\Core\DependencyInjection\Compiler; +use InvalidArgumentException; use ReflectionClass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; @@ -29,7 +30,7 @@ class RegisterKernelListenersPass implements CompilerPassInterface $refClass = new ReflectionClass($class); $interface = 'Symfony\Component\EventDispatcher\EventSubscriberInterface'; if (!$refClass->implementsInterface($interface)) { - throw new \InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface)); + throw new InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface)); } $definition->addMethodCall('addSubscriberService', array($id, $class)); }