public function cache($conf = 'default_cache')
{
if (is_array($conf)) {
$config = $conf;
$conf = md5(json_encode($conf));
} else {
$config = Config::get($conf);
}
if (isset(self::$cacheInstance[$conf])) {
return self::$cacheInstance[$conf];
} else {
if ($config['on']) {
self::$cacheInstance[$conf] = Cml::getContainer()->make('cache_' . strtolower($config['driver']), $config);
return self::$cacheInstance[$conf];
} else {
throw new \InvalidArgumentException(Lang::get('_NOT_OPEN_', $conf));
}
}
}