Welcome Guest, Not a member yet? Register   Sign In
Caching in custom database group.
#1

[eluser]kamilko[/eluser]
Hi.
I have following case:
database config group called 'configuration' and of course an 'default' group.
I'm trying to load database 'configuration' without loading 'default' database in library which is loaded in controller constructor.
so my library constructor looks like this:
Code:
function __construct() {
    $this->obj =& get_instance();
    $this->db = $this->obj->load->database('configuration', TRUE);
}

my part of configuration group looks like:
Code:
$db['configuration']['cache_on'] = TRUE;
$db['configuration']['cachedir'] = "/tmp";

and when I trying load my library I have following error:
Quote:Fatal error: Call to a member function cache_off() on a non-object in ...system/database/DB_cache.php on line 58

Obviously '/tmp' dir has access for httpd process and it doesn't matter if I use 'mysql' or 'mysqli' driver.

If I place in constructor before loading 'configuration' group following code:
Code:
$this->obj->load->database();
Error is gone - but I'm not sure if then I have cached 'configuration' group instead of only group 'default'.


Messages In This Thread
Caching in custom database group. - by El Forum - 03-05-2008, 12:13 PM
Caching in custom database group. - by El Forum - 03-05-2008, 04:14 PM
Caching in custom database group. - by El Forum - 03-06-2008, 05:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB