From b1938ce0913f05b3899b10287fba09acc710c598 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 19 Jul 2009 05:26:11 +0000 Subject: [PATCH] #523358 by catch: Speed up drupal_function_exists(). --- includes/bootstrap.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 3693719f159..ba88daf7b41 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1663,8 +1663,13 @@ function drupal_get_schema($table = NULL, $rebuild = FALSE) { */ function drupal_function_exists($function) { static $checked = array(); + static $maintenance; - if (defined('MAINTENANCE_MODE')) { + if (!isset($maintenance)) { + $maintenance = defined('MAINTENANCE_MODE'); + } + + if ($maintenance) { return function_exists($function); }