summaryrefslogtreecommitdiff
path: root/modules/color
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-04-22 23:25:32 +0000
committerDries Buytaert <dries@buytaert.net>2010-04-22 23:25:32 +0000
commit43c86c4e6f8c59ca588d84455f054d83528aa9bc (patch)
tree8019d1210ab1b195f35fa39babd1bf87ef96d2cf /modules/color
parent8cb52e47c1d0ea1009921c14d585b0194b532ec5 (diff)
downloadbrdo-43c86c4e6f8c59ca588d84455f054d83528aa9bc.tar.gz
brdo-43c86c4e6f8c59ca588d84455f054d83528aa9bc.tar.bz2
- Patch #778880 by Steven Merrill: add static caching to color.module.
Diffstat (limited to 'modules/color')
-rw-r--r--modules/color/color.module7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/color/color.module b/modules/color/color.module
index 1a8414da2..0f27c99dc 100644
--- a/modules/color/color.module
+++ b/modules/color/color.module
@@ -115,10 +115,17 @@ function _color_page_alter(&$vars) {
* Retrieve the color.module info for a particular theme.
*/
function color_get_info($theme) {
+ static $theme_info = array();
+
+ if (isset($theme_info[$theme])) {
+ return $theme_info[$theme];
+ }
+
$path = drupal_get_path('theme', $theme);
$file = DRUPAL_ROOT . '/' . $path . '/color/color.inc';
if ($path && file_exists($file)) {
include $file;
+ $theme_info[$theme] = $info;
return $info;
}
}