diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-10-31 14:00:37 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-10-31 14:00:37 +0000 |
commit | 086d1890113cf4c33775c42bee34b960c9fa098a (patch) | |
tree | 5628645a55052b12b40df3a9ee34ecfb0a86e5a3 /includes | |
parent | fc6656b3c3e45663d93f440b61ecebda07585686 (diff) | |
download | brdo-086d1890113cf4c33775c42bee34b960c9fa098a.tar.gz brdo-086d1890113cf4c33775c42bee34b960c9fa098a.tar.bz2 |
- Patch #572452 by catch, JoshuaRogers: drupal_get_filename() and drupal_load() should not use drupal_static(). Performance improvement.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/bootstrap.inc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 767aa07ac..f463c1c7a 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -631,7 +631,9 @@ function drupal_settings_initialize() { * The filename of the requested item. */ function drupal_get_filename($type, $name, $filename = NULL) { - $files = &drupal_static(__FUNCTION__, array()); + // The location of files will not change during the request, so do not use + // drupal_static(). + static $files = array(); if (!isset($files[$type])) { $files[$type] = array(); @@ -834,7 +836,9 @@ function bootstrap_invoke_all($hook) { * TRUE if the item is loaded or has already been loaded. */ function drupal_load($type, $name) { - $files = &drupal_static(__FUNCTION__, array()); + // Once a file is included this can't be reversed during a request so do not + // use drupal_static() here. + static $files = array(); if (isset($files[$type][$name])) { return TRUE; |