From 06f8e0f098c60a17a7c9ace358fcc287c23fdc9d Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Fri, 24 Mar 2006 15:41:28 +0000 Subject: [PATCH] Use function_exists to start APD profiling support. --- config/dmsDefaults.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/config/dmsDefaults.php b/config/dmsDefaults.php index 49e4f70..ceed029 100644 --- a/config/dmsDefaults.php +++ b/config/dmsDefaults.php @@ -23,8 +23,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// DEBUG DEBUG DEBUG APD -//if (extension_loaded('APD')) { apd_set_pprof_trace(); } +if (function_exists('apd_set_pprof_trace')) { + apd_set_pprof_trace(); +} // Default settings differ, we need some of these, so force the matter. // Can be overridden here if actually necessary. @@ -368,7 +369,7 @@ class KTInit { if (!KTUtil::isAbsolutePath($cache_file)) { $cache_file = sprintf("%s/%s", KT_DIR, $cache_file); } $config_file = trim(file_get_contents(KT_DIR . "/config/config-path")); if (!KTUtil::isAbsolutePath($config_file)) { $config_file = sprintf("%s/%s", KT_DIR, $config_file); } - + $exists = file_exists($cache_file); if ($exists) { $cachestat = stat($cache_file); @@ -426,13 +427,15 @@ class KTInit { $this->readConfig(); $oKTConfig =& KTConfig::getSingleton(); - if ($store_cache) { $oKTConfig->createCache($cache_file);} + if ($store_cache && is_writable($cache_file)) { + $oKTConfig->createCache($cache_file); + } } } // }}} - + // {{{ readConfig function readConfig () { global $default; -- libgit2 0.21.4