summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-03-29 21:01:47 +0000
committerDries Buytaert <dries@buytaert.net>2005-03-29 21:01:47 +0000
commit99233a9c991635e801aebc276e4e2975b6ba9e20 (patch)
tree64b935b10913cbad252be1c67f8882a036e5b2e2 /includes
parenta9091183e1234def7edf03570a15c13fea5262e8 (diff)
downloadbrdo-99233a9c991635e801aebc276e4e2975b6ba9e20.tar.gz
brdo-99233a9c991635e801aebc276e4e2975b6ba9e20.tar.bz2
- Patch #19590 by Moshe: lazy initialization of the theme system. Improves
performance of pages that don't need the theme system (such as RSS feeds) and makes it easier to set a custom theme.
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc3
-rw-r--r--includes/theme.inc8
2 files changed, 6 insertions, 5 deletions
diff --git a/includes/common.inc b/includes/common.inc
index cfa48aa9d..f3abbac85 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1905,7 +1905,4 @@ if (!user_access('bypass input data check')) {
// Initialize the localization system.
$locale = locale_initialize();
-// Initialize the enabled theme.
-$theme = init_theme();
-
?>
diff --git a/includes/theme.inc b/includes/theme.inc
index 11004306b..14b2181e3 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -171,8 +171,12 @@ function list_theme_engines($refresh = FALSE) {
* An HTML string that generates the themed output.
*/
function theme() {
- global $theme;
- global $theme_engine;
+ global $theme, $theme_engine;
+
+ if (!$theme) {
+ // Initialize the enabled theme.
+ $theme = init_theme();
+ }
$args = func_get_args();
$function = array_shift($args);