From 51c0b55a235ebcac022d6f5576c209edf98c38fe Mon Sep 17 00:00:00 2001 From: Brian Gottier Date: Tue, 13 Nov 2012 18:47:19 -0800 Subject: 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 db7636450..d023db979 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -95,12 +95,22 @@ class CI_DB_Cache { ? 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; } -- cgit v1.2.3-24-g4f1b From 4a18c9505040f5b0fc1129ec7f167baeae016080 Mon Sep 17 00:00:00 2001 From: Brian Gottier Date: Wed, 14 Nov 2012 07:40:55 -0800 Subject: Changes per narfbg --- system/database/DB_cache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index d023db979..fd01dc2d8 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -97,7 +97,7 @@ class CI_DB_Cache { if ( ! is_dir($path)) { - log_message('debug', 'Cache Path Error: '.$path); + log_message('debug', 'DB cache path error: '.$path); // If the path is wrong we'll turn off caching return $this->db->cache_off(); @@ -105,7 +105,7 @@ class CI_DB_Cache { if ( ! is_really_writable($path)) { - log_message('debug', 'Cache Dir Not Writable: '.$path); + log_message('debug', 'DB cache dir not writable: '.$path); // If the path is not really writable we'll turn off caching return $this->db->cache_off(); -- cgit v1.2.3-24-g4f1b