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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
a8f9ad3c
Commit
a8f9ad3c
authored
12 years ago
by
catch
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1806988
by sun: Factor out duplicate code from system_list().
parent
660cf8cb
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/includes/module.inc
+19
-6
19 additions, 6 deletions
core/includes/module.inc
with
19 additions
and
6 deletions
core/includes/module.inc
+
19
−
6
View file @
a8f9ad3c
...
...
@@ -96,8 +96,7 @@ function module_list($type = 'module_enabled', array $fixed_list = NULL, $reset
if
(
isset
(
$fixed_list
))
{
$module_list
=
array
();
foreach
(
$fixed_list
as
$name
=>
$module
)
{
drupal_classloader_register
(
$name
,
dirname
(
$module
[
'filename'
]));
drupal_get_filename
(
'module'
,
$name
,
$module
[
'filename'
]);
system_register
(
'module'
,
$name
,
$module
[
'filename'
]);
$module_list
[
$name
]
=
$name
;
}
$list
=
$module_list
;
...
...
@@ -161,8 +160,7 @@ function system_list($type) {
// drupal_get_filename() static cache for bootstrap modules only.
// The rest is stored separately to keep the bootstrap module cache small.
foreach
(
$bootstrap_list
as
$name
=>
$filename
)
{
drupal_classloader_register
(
$name
,
dirname
(
$filename
));
drupal_get_filename
(
'module'
,
$name
,
$filename
);
system_register
(
'module'
,
$name
,
$filename
);
}
// We only return the module names here since module_list() doesn't need
// the filename itself.
...
...
@@ -256,8 +254,7 @@ function system_list($type) {
// To avoid a separate database lookup for the filepath, prime the
// drupal_get_filename() static cache with all enabled modules and themes.
foreach
(
$lists
[
'filepaths'
]
as
$item
)
{
drupal_get_filename
(
$item
[
'type'
],
$item
[
'name'
],
$item
[
'filepath'
]);
drupal_classloader_register
(
$item
[
'name'
],
dirname
(
$item
[
'filepath'
]));
system_register
(
$item
[
'type'
],
$item
[
'name'
],
$item
[
'filepath'
]);
}
}
...
...
@@ -283,6 +280,22 @@ function system_list_reset() {
state
()
->
delete
(
'system.theme.data'
);
}
/**
* Registers an extension in runtime registries for execution.
*
* @param string $type
* The extension type; e.g., 'module' or 'theme'.
* @param string $name
* The internal name of the extension; e.g., 'node'.
* @param string $uri
* The relative URI of the primary extension file; e.g.,
* 'core/modules/node/node.module'.
*/
function
system_register
(
$type
,
$name
,
$uri
)
{
drupal_get_filename
(
$type
,
$name
,
$uri
);
drupal_classloader_register
(
$name
,
dirname
(
$uri
));
}
/**
* Determines which modules require and are required by each 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