From 1bf98066ba6546039f8d2c888381aa4e9d7d4a5b Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Sat, 11 Aug 2012 15:25:48 -0500 Subject: [PATCH] Convert LegacyUrlMatcher to use RequestMatcherInterface rather than UrlMatcherInterface. --- core/lib/Drupal/Core/CoreBundle.php | 2 +- core/lib/Drupal/Core/LegacyUrlMatcher.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/lib/Drupal/Core/CoreBundle.php b/core/lib/Drupal/Core/CoreBundle.php index 4dca8043089..925e315cb0f 100644 --- a/core/lib/Drupal/Core/CoreBundle.php +++ b/core/lib/Drupal/Core/CoreBundle.php @@ -59,7 +59,7 @@ class CoreBundle extends Bundle $dispatcher = $container->get('dispatcher'); $matcher = new \Drupal\Core\LegacyUrlMatcher(); $content_negotation = new \Drupal\Core\ContentNegotiation(); - $dispatcher->addSubscriber(new \Drupal\Core\EventSubscriber\RouterListener($matcher)); + $dispatcher->addSubscriber(new \Symfony\Component\HttpKernel\EventListener\RouterListener($matcher)); $dispatcher->addSubscriber(new \Drupal\Core\EventSubscriber\ViewSubscriber($content_negotation)); $dispatcher->addSubscriber(new \Drupal\Core\EventSubscriber\AccessSubscriber()); $dispatcher->addSubscriber(new \Drupal\Core\EventSubscriber\MaintenanceModeSubscriber()); diff --git a/core/lib/Drupal/Core/LegacyUrlMatcher.php b/core/lib/Drupal/Core/LegacyUrlMatcher.php index 8828f36d27b..48987a9291f 100644 --- a/core/lib/Drupal/Core/LegacyUrlMatcher.php +++ b/core/lib/Drupal/Core/LegacyUrlMatcher.php @@ -9,13 +9,14 @@ namespace Drupal\Core; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Exception\ResourceNotFoundException; -use Symfony\Component\Routing\Matcher\UrlMatcherInterface; +use Symfony\Component\Routing\Matcher\RequestMatcherInterface; +use Symfony\Component\Routing\RequestContextAwareInterface; use Symfony\Component\Routing\RequestContext; /** * UrlMatcher matches URL based on a set of routes. */ -class LegacyUrlMatcher implements UrlMatcherInterface { +class LegacyUrlMatcher implements RequestMatcherInterface, RequestContextAwareInterface { /** * The request context for this matcher. @@ -98,8 +99,8 @@ class LegacyUrlMatcher implements UrlMatcherInterface { * * @api */ - public function match($pathinfo) { - if ($router_item = $this->matchDrupalItem($pathinfo)) { + public function matchRequest(Request $request) { + if ($router_item = $this->matchDrupalItem($request->attributes->get('system_path'))) { $ret = $this->convertDrupalItem($router_item); // Stash the router item in the attributes while we're transitioning. $ret['drupal_menu_item'] = $router_item;