From 51c0b55a235ebcac022d6f5576c209edf98c38fe Mon Sep 17 00:00:00 2001 From: Brian Gottier Date: Tue, 13 Nov 2012 18:47:19 -0800 Subject: [PATCH] Better debugging for DB Cache path --- system/database/DB_cache.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index db7636450d8..d023db97996 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -95,12 +95,22 @@ public function check_path($path = '') ? rtrim(realpath($path), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR : rtrim($path, '/').'/'; - if ( ! is_dir($path) OR ! is_really_writable($path)) + if ( ! is_dir($path)) { + log_message('debug', 'Cache Path Error: '.$path); + // If the path is wrong we'll turn off caching return $this->db->cache_off(); } + if ( ! is_really_writable($path)) + { + log_message('debug', 'Cache Dir Not Writable: '.$path); + + // If the path is not really writable we'll turn off caching + return $this->db->cache_off(); + } + $this->db->cachedir = $path; return TRUE; }