Skip to content

Commit

Permalink
Merge pull request #1998 from skunkbad/develop
Browse files Browse the repository at this point in the history
Better debugging for DB Cache path
  • Loading branch information
narfbg committed Nov 14, 2012
2 parents 878c4bd + 4a18c95 commit 20209d6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion system/database/DB_cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', 'DB 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', 'DB 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;
}
Expand Down

0 comments on commit 20209d6

Please sign in to comment.