Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
9ee9817d
Commit
9ee9817d
authored
Apr 10, 2011
by
Dries Buytaert
Browse files
- Patch
#733306
by atchijov, carlos8f: add static caching for drupal_parse_info_file().
parent
9e4c8987
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
9ee9817d
...
...
@@ -6919,12 +6919,18 @@ function drupal_write_record($table, &$record, $primary_keys = array()) {
* @see drupal_parse_info_format()
*/
function
drupal_parse_info_file
(
$filename
)
{
if
(
!
file_exists
(
$filename
))
{
return
array
();
}
$info
=
&
drupal_static
(
__FUNCTION__
,
array
());
$data
=
file_get_contents
(
$filename
);
return
drupal_parse_info_format
(
$data
);
if
(
!
isset
(
$info
[
$filename
]))
{
if
(
!
file_exists
(
$filename
))
{
$info
[
$filename
]
=
array
();
}
else
{
$data
=
file_get_contents
(
$filename
);
$info
[
$filename
]
=
drupal_parse_info_format
(
$data
);
}
}
return
$info
[
$filename
];
}
/**
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment