Welcome Guest, Not a member yet? Register   Sign In
Multiple DB connections and caching
#3

[eluser]skunkbad[/eluser]
[quote author="Narf" date="1352797159"]https://github.com/EllisLab/CodeIgniter/...d8acdd7ca6

How about now?[/quote]

Hey, cool. I knew I was on to something there. I've never used caching, so I thought I'd play around with it and see how it works (and doesn't work).

I do have a suggestion. In the check_path method of DB_Cache, where the if statement checks if the path is a dir and is writable, it would be nice if those were separated out, and if there was a log_message, show_error, or something to make it more obvious which failed. In my own testing, I found this useful:

Code:
if ( ! is_dir($path) )
{
\CI\DB::log('Cache Path Error: ' . $path );

// If the path is wrong we'll turn off caching
return $this->db->cache_off();
}

if ( ! is_really_writable($path) )
{
\CI\DB::log('Cache Dir Not Writable: ' . $path );

// If the path is not really writable we'll turn off caching
return $this->db->cache_off();
}

I've obviously been playing around with some customization, but it was helpful when setting up caching, and other people might think so too.


Messages In This Thread
Multiple DB connections and caching - by El Forum - 11-12-2012, 09:45 PM
Multiple DB connections and caching - by El Forum - 11-13-2012, 01:59 AM
Multiple DB connections and caching - by El Forum - 11-13-2012, 08:58 AM
Multiple DB connections and caching - by El Forum - 11-13-2012, 12:21 PM
Multiple DB connections and caching - by El Forum - 11-13-2012, 01:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB