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
292
Merge Requests
292
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
f98273f9
Commit
f98273f9
authored
Oct 16, 2011
by
Dries Buytaert
Committed by
Dries
Oct 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#1081266
by mfb: avoid re-scanning module directory when multiple modules are missing.
parent
fb97b53f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
includes/bootstrap.inc
includes/bootstrap.inc
+14
-11
No files found.
includes/bootstrap.inc
View file @
f98273f9
...
...
@@ -850,7 +850,7 @@ function drupal_settings_initialize() {
function
drupal_get_filename
(
$type
,
$name
,
$filename
=
NULL
)
{
// The location of files will not change during the request, so do not use
// drupal_static().
static
$files
=
array
();
static
$files
=
array
()
,
$dirs
=
array
()
;
if
(
!
isset
(
$files
[
$type
]))
{
$files
[
$type
]
=
array
();
...
...
@@ -896,16 +896,19 @@ function drupal_get_filename($type, $name, $filename = NULL) {
$extension
=
$type
;
}
if
(
!
function_exists
(
'drupal_system_listing'
))
{
require_once
DRUPAL_ROOT
.
'/includes/common.inc'
;
}
// Scan the appropriate directories for all files with the requested
// extension, not just the file we are currently looking for. This
// prevents unnecessary scans from being repeated when this function is
// called more than once in the same page request.
$matches
=
drupal_system_listing
(
"/^"
.
DRUPAL_PHP_FUNCTION_PATTERN
.
"\.
$extension
$/"
,
$dir
,
'name'
,
0
);
foreach
(
$matches
as
$matched_name
=>
$file
)
{
$files
[
$type
][
$matched_name
]
=
$file
->
uri
;
if
(
!
isset
(
$dirs
[
$dir
][
$extension
]))
{
$dirs
[
$dir
][
$extension
]
=
TRUE
;
if
(
!
function_exists
(
'drupal_system_listing'
))
{
require_once
DRUPAL_ROOT
.
'/includes/common.inc'
;
}
// Scan the appropriate directories for all files with the requested
// extension, not just the file we are currently looking for. This
// prevents unnecessary scans from being repeated when this function is
// called more than once in the same page request.
$matches
=
drupal_system_listing
(
"/^"
.
DRUPAL_PHP_FUNCTION_PATTERN
.
"\.
$extension
$/"
,
$dir
,
'name'
,
0
);
foreach
(
$matches
as
$matched_name
=>
$file
)
{
$files
[
$type
][
$matched_name
]
=
$file
->
uri
;
}
}
}
}
...
...
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