From 43c86c4e6f8c59ca588d84455f054d83528aa9bc Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 22 Apr 2010 23:25:32 +0000 Subject: [PATCH] - Patch #778880 by Steven Merrill: add static caching to color.module. --- modules/color/color.module | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/color/color.module b/modules/color/color.module index 1a8414da25d..0f27c99dcff 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; } }