Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
304
Merge Requests
304
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
ac10076c
Commit
ac10076c
authored
Aug 11, 2012
by
Crell
Committed by
effulgentsia
Oct 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wire the new PartialMatcher and PathMatcher into the routing configuration.
parent
a6d59f6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
197 additions
and
0 deletions
+197
-0
core/lib/Drupal/Core/CoreBundle.php
core/lib/Drupal/Core/CoreBundle.php
+9
-0
core/modules/system/system.install
core/modules/system/system.install
+188
-0
No files found.
core/lib/Drupal/Core/CoreBundle.php
View file @
ac10076c
...
...
@@ -15,6 +15,8 @@
use
Symfony\Component\HttpKernel\Bundle\Bundle
;
use
Symfony\Component\DependencyInjection\Compiler\PassConfig
;
use
Drupal\Core\Database\Database
;
/**
* Bundle class for mandatory core services.
*
...
...
@@ -59,6 +61,13 @@ public function build(ContainerBuilder $container) {
$dispatcher
=
$container
->
get
(
'dispatcher'
);
$matcher
=
new
\
Drupal\Core\Routing\ChainMatcher
();
$matcher
->
add
(
new
\
Drupal\Core\LegacyUrlMatcher
());
$nested
=
new
\
Drupal\Core\Routing\NestedMatcher
();
$nested
->
setInitialMatcher
(
new
\
Drupal\Core\Routing\PathMatcher
(
Database
::
getConnection
()));
$nested
->
addPartialMatcher
(
new
\
Drupal\Core\Routing\HttpMethodMatcher
());
$nested
->
setFinalMatcher
(
new
\
Drupal\Core\Routing\FirstEntryFinalMatcher
());
$matcher
->
add
(
$nested
,
5
);
$content_negotation
=
new
\
Drupal\Core\ContentNegotiation
();
$dispatcher
->
addSubscriber
(
new
\
Symfony\Component\HttpKernel\EventListener\RouterListener
(
$matcher
));
$dispatcher
->
addSubscriber
(
new
\
Drupal\Core\EventSubscriber\ViewSubscriber
(
$content_negotation
));
...
...
core/modules/system/system.install
View file @
ac10076c
...
...
@@ -1225,6 +1225,125 @@ function system_schema() {
),
);
$schema
[
'registry'
]
=
array
(
'description'
=>
"Each record is a function, class, or interface name and the file it is in."
,
'fields'
=>
array
(
'name'
=>
array
(
'description'
=>
'The name of the function, class, or interface.'
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default'
=>
''
,
),
'type'
=>
array
(
'description'
=>
'Either function or class or interface.'
,
'type'
=>
'varchar'
,
'length'
=>
9
,
'not null'
=>
TRUE
,
'default'
=>
''
,
),
'filename'
=>
array
(
'description'
=>
'Name of the file.'
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
),
'module'
=>
array
(
'description'
=>
'Name of the module the file belongs to.'
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default'
=>
''
),
'weight'
=>
array
(
'description'
=>
"The order in which this module's hooks should be invoked relative to other modules. Equal-weighted modules are ordered by name."
,
'type'
=>
'int'
,
'not null'
=>
TRUE
,
'default'
=>
0
,
),
),
'primary key'
=>
array
(
'name'
,
'type'
),
'indexes'
=>
array
(
'hook'
=>
array
(
'type'
,
'weight'
,
'module'
),
),
);
$schema
[
'registry_file'
]
=
array
(
'description'
=>
"Files parsed to build the registry."
,
'fields'
=>
array
(
'filename'
=>
array
(
'description'
=>
'Path to the file.'
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
),
'hash'
=>
array
(
'description'
=>
"sha-256 hash of the file's contents when last parsed."
,
'type'
=>
'varchar'
,
'length'
=>
64
,
'not null'
=>
TRUE
,
),
),
'primary key'
=>
array
(
'filename'
),
);
$schema
[
'router'
]
=
array
(
'description'
=>
'Maps paths to various callbacks (access, page and title)'
,
'fields'
=>
array
(
'name'
=>
array
(
'description'
=>
'Primary Key: Machine name of this route'
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default'
=>
''
,
),
'pattern'
=>
array
(
'description'
=>
'The path pattern for this URI'
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default'
=>
''
,
),
'pattern_outline'
=>
array
(
'description'
=>
'The pattern'
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default'
=>
''
,
),
'route_set'
=>
array
(
'description'
=>
'The route set grouping to which a route belongs.'
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default'
=>
''
,
),
'fit'
=>
array
(
'description'
=>
'A numeric representation of how specific the path is.'
,
'type'
=>
'int'
,
'not null'
=>
TRUE
,
'default'
=>
0
,
),
'route'
=>
array
(
'description'
=>
'A serialized Route object'
,
'type'
=>
'text'
,
),
'number_parts'
=>
array
(
'description'
=>
'Number of parts in this router path.'
,
'type'
=>
'int'
,
'not null'
=>
TRUE
,
'default'
=>
0
,
'size'
=>
'small'
,
),
),
'indexes'
=>
array
(
'fit'
=>
array
(
'fit'
),
'pattern_outline'
=>
array
(
'pattern_outline'
),
'route_set'
=>
array
(
'route_set'
),
),
'primary key'
=>
array
(
'name'
),
);
$schema
[
'semaphore'
]
=
array
(
'description'
=>
'Table for holding semaphores, locks, flags, etc. that cannot be stored as Drupal variables since they must not be cached.'
,
'fields'
=>
array
(
...
...
@@ -1914,6 +2033,75 @@ function system_update_8019() {
db_drop_table
(
'registry_file'
);
}
/*
* Create the new routing table.
*/
function
system_update_8020
()
{
$tables
[
'router'
]
=
array
(
'description'
=>
'Maps paths to various callbacks (access, page and title)'
,
'fields'
=>
array
(
'name'
=>
array
(
'description'
=>
'Primary Key: Machine name of this route'
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default'
=>
''
,
),
'pattern'
=>
array
(
'description'
=>
'The path pattern for this URI'
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default'
=>
''
,
),
'pattern_outline'
=>
array
(
'description'
=>
'The pattern'
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default'
=>
''
,
),
'route_set'
=>
array
(
'description'
=>
'The route set grouping to which a route belongs.'
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default'
=>
''
,
),
'fit'
=>
array
(
'description'
=>
'A numeric representation of how specific the path is.'
,
'type'
=>
'int'
,
'not null'
=>
TRUE
,
'default'
=>
0
,
),
'route'
=>
array
(
'description'
=>
'A serialized Route object'
,
'type'
=>
'text'
,
),
'number_parts'
=>
array
(
'description'
=>
'Number of parts in this router path.'
,
'type'
=>
'int'
,
'not null'
=>
TRUE
,
'default'
=>
0
,
'size'
=>
'small'
,
),
),
'indexes'
=>
array
(
'fit'
=>
array
(
'fit'
),
'pattern_outline'
=>
array
(
'pattern_outline'
),
'route_set'
=>
array
(
'route_set'
),
),
'primary key'
=>
array
(
'name'
),
);
$schema
=
Database
::
getConnection
()
->
schema
();
$schema
->
dropTable
(
'router'
);
$schema
->
createTable
(
'router'
,
$tables
[
'router'
]);
}
/**
* Conditionally enable the new Ban module.
*/
...
...
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