Commit 06f8e0f098c60a17a7c9ace358fcc287c23fdc9d

Authored by Neil Blakey-Milner
1 parent 840b2ee0

Use function_exists to start APD profiling support.

Only write to the cache file if it is writeable.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5126 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 8 additions and 5 deletions
config/dmsDefaults.php
@@ -23,8 +23,9 @@ @@ -23,8 +23,9 @@
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */ 24 */
25 25
26 -// DEBUG DEBUG DEBUG APD  
27 -//if (extension_loaded('APD')) { apd_set_pprof_trace(); } 26 +if (function_exists('apd_set_pprof_trace')) {
  27 + apd_set_pprof_trace();
  28 +}
28 29
29 // Default settings differ, we need some of these, so force the matter. 30 // Default settings differ, we need some of these, so force the matter.
30 // Can be overridden here if actually necessary. 31 // Can be overridden here if actually necessary.
@@ -368,7 +369,7 @@ class KTInit { @@ -368,7 +369,7 @@ class KTInit {
368 if (!KTUtil::isAbsolutePath($cache_file)) { $cache_file = sprintf("%s/%s", KT_DIR, $cache_file); } 369 if (!KTUtil::isAbsolutePath($cache_file)) { $cache_file = sprintf("%s/%s", KT_DIR, $cache_file); }
369 $config_file = trim(file_get_contents(KT_DIR . "/config/config-path")); 370 $config_file = trim(file_get_contents(KT_DIR . "/config/config-path"));
370 if (!KTUtil::isAbsolutePath($config_file)) { $config_file = sprintf("%s/%s", KT_DIR, $config_file); } 371 if (!KTUtil::isAbsolutePath($config_file)) { $config_file = sprintf("%s/%s", KT_DIR, $config_file); }
371 - 372 +
372 $exists = file_exists($cache_file); 373 $exists = file_exists($cache_file);
373 if ($exists) { 374 if ($exists) {
374 $cachestat = stat($cache_file); 375 $cachestat = stat($cache_file);
@@ -426,13 +427,15 @@ class KTInit { @@ -426,13 +427,15 @@ class KTInit {
426 $this->readConfig(); 427 $this->readConfig();
427 428
428 $oKTConfig =& KTConfig::getSingleton(); 429 $oKTConfig =& KTConfig::getSingleton();
429 - if ($store_cache) { $oKTConfig->createCache($cache_file);} 430 + if ($store_cache && is_writable($cache_file)) {
  431 + $oKTConfig->createCache($cache_file);
  432 + }
430 433
431 434
432 } 435 }
433 } 436 }
434 // }}} 437 // }}}
435 - 438 +
436 // {{{ readConfig 439 // {{{ readConfig
437 function readConfig () { 440 function readConfig () {
438 global $default; 441 global $default;