Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
ac10076c
Commit
ac10076c
authored
Aug 11, 2012
by
Larry Garfield
Committed by
Alex Bronstein
Oct 1, 2012
Browse files
Options
Downloads
Patches
Plain Diff
Wire the new PartialMatcher and PathMatcher into the routing configuration.
parent
a6d59f6d
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/lib/Drupal/Core/CoreBundle.php
+9
-0
9 additions, 0 deletions
core/lib/Drupal/Core/CoreBundle.php
core/modules/system/system.install
+188
-0
188 additions, 0 deletions
core/modules/system/system.install
with
197 additions
and
0 deletions
core/lib/Drupal/Core/CoreBundle.php
+
9
−
0
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
));
...
...
This diff is collapsed.
Click to expand it.
core/modules/system/system.install
+
188
−
0
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.
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment