[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'.