Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
1bf98066
Commit
1bf98066
authored
Aug 11, 2012
by
Crell
Committed by
effulgentsia
Oct 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert LegacyUrlMatcher to use RequestMatcherInterface rather than UrlMatcherInterface.
parent
41586439
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
core/lib/Drupal/Core/CoreBundle.php
core/lib/Drupal/Core/CoreBundle.php
+1
-1
core/lib/Drupal/Core/LegacyUrlMatcher.php
core/lib/Drupal/Core/LegacyUrlMatcher.php
+5
-4
No files found.
core/lib/Drupal/Core/CoreBundle.php
View file @
1bf98066
...
@@ -59,7 +59,7 @@ public function build(ContainerBuilder $container) {
...
@@ -59,7 +59,7 @@ public function build(ContainerBuilder $container) {
$dispatcher
=
$container
->
get
(
'dispatcher'
);
$dispatcher
=
$container
->
get
(
'dispatcher'
);
$matcher
=
new
\
Drupal\Core\LegacyUrlMatcher
();
$matcher
=
new
\
Drupal\Core\LegacyUrlMatcher
();
$content_negotation
=
new
\
Drupal\Core\ContentNegotiation
();
$content_negotation
=
new
\
Drupal\Core\ContentNegotiation
();
$dispatcher
->
addSubscriber
(
new
\
Drupal\Core\EventSubscrib
er\RouterListener
(
$matcher
));
$dispatcher
->
addSubscriber
(
new
\
Symfony\Component\HttpKernel\EventListen
er\RouterListener
(
$matcher
));
$dispatcher
->
addSubscriber
(
new
\
Drupal\Core\EventSubscriber\ViewSubscriber
(
$content_negotation
));
$dispatcher
->
addSubscriber
(
new
\
Drupal\Core\EventSubscriber\ViewSubscriber
(
$content_negotation
));
$dispatcher
->
addSubscriber
(
new
\
Drupal\Core\EventSubscriber\AccessSubscriber
());
$dispatcher
->
addSubscriber
(
new
\
Drupal\Core\EventSubscriber\AccessSubscriber
());
$dispatcher
->
addSubscriber
(
new
\
Drupal\Core\EventSubscriber\MaintenanceModeSubscriber
());
$dispatcher
->
addSubscriber
(
new
\
Drupal\Core\EventSubscriber\MaintenanceModeSubscriber
());
...
...
core/lib/Drupal/Core/LegacyUrlMatcher.php
View file @
1bf98066
...
@@ -9,13 +9,14 @@
...
@@ -9,13 +9,14 @@
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\Routing\Exception\ResourceNotFoundException
;
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
;
use
Symfony\Component\Routing\RequestContext
;
/**
/**
* UrlMatcher matches URL based on a set of routes.
* UrlMatcher matches URL based on a set of routes.
*/
*/
class
LegacyUrlMatcher
implements
UrlMatcher
Interface
{
class
LegacyUrlMatcher
implements
RequestMatcherInterface
,
RequestContextAware
Interface
{
/**
/**
* The request context for this matcher.
* The request context for this matcher.
...
@@ -98,8 +99,8 @@ public function getRequest() {
...
@@ -98,8 +99,8 @@ public function getRequest() {
*
*
* @api
* @api
*/
*/
public
function
match
(
$pathinfo
)
{
public
function
match
Request
(
Request
$request
)
{
if
(
$router_item
=
$this
->
matchDrupalItem
(
$
pathinfo
))
{
if
(
$router_item
=
$this
->
matchDrupalItem
(
$
request
->
attributes
->
get
(
'system_path'
)
))
{
$ret
=
$this
->
convertDrupalItem
(
$router_item
);
$ret
=
$this
->
convertDrupalItem
(
$router_item
);
// Stash the router item in the attributes while we're transitioning.
// Stash the router item in the attributes while we're transitioning.
$ret
[
'drupal_menu_item'
]
=
$router_item
;
$ret
[
'drupal_menu_item'
]
=
$router_item
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment