Welcome Guest, Not a member yet? Register   Sign In
DB can't cached in CI 1.7.2
#1

[eluser]Unknown[/eluser]
Hi all,

I'm using CI 1.7.2 to developing my project, and found the db cache can't work.
following is database config:
$active_group = "default";
$active_record = FALSE;

$db['default']['hostname'] = "192.168.1.15";
$db['default']['username'] = "mydb";
$db['default']['password'] = "mysql";
$db['default']['database'] = "db_jp";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "dbcache";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
NOTE: "dbcache" folder in system, and it attribute is 777.
and in model I use $this->db->cache_on(); but it didn't work. in database DB_Cache.php file I found that "$path = $this->db->cachedir;" it is relative path, so I modified to absolute path add this sentence: "if ($path{0} !== '/') $path = BASEPATH . $path;" in it.and it is worked fine.




Theme © iAndrew 2016 - Forum software by © MyBB