From 6ca58334607623586ffc69e80f445c578f588929 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 14 Apr 2010 15:20:51 -0600 Subject: [PATCH] grab directory name once --- horde/lib/core.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/horde/lib/core.php b/horde/lib/core.php index 2a275e481..84a1e4d08 100644 --- a/horde/lib/core.php +++ b/horde/lib/core.php @@ -23,11 +23,13 @@ if (ini_get('register_globals')) { exit('Register globals is enabled. Exiting.'); } +$dirname = dirname(__FILE__); + if (!defined('HORDE_BASE')) { - define('HORDE_BASE', dirname(__FILE__) . '/..'); + define('HORDE_BASE', $dirname . '/..'); } -ini_set('include_path', dirname(__FILE__) . PATH_SEPARATOR . ini_get('include_path')); +ini_set('include_path', $dirname . PATH_SEPARATOR . ini_get('include_path')); if (file_exists(HORDE_BASE . '/config/horde.local.php')) { include HORDE_BASE . '/config/horde.local.php'; } @@ -36,7 +38,7 @@ if (file_exists(HORDE_BASE . '/config/horde.local.php')) { * be defined in Horde_Autoloader since the current directory path can not be * determined there. */ include_once 'Horde/Autoloader.php'; -Horde_Autoloader::addClassPattern('/^Horde(?:$|_)/i', dirname(__FILE__)); +Horde_Autoloader::addClassPattern('/^Horde(?:$|_)/i', $dirname); /* Default exception handler for uncaught exceptions. The default fatal * exception handler output may include things like passwords, etc. so don't -- 2.11.0