function save($data, $id = null, $group = 'default')
{
if ($this->_caching) {
if ($this->_automaticSerialization) {
$data = serialize($data);
}
if (isset($id)) {
$this->_setFileName($id, $group);
}
if ($this->_memoryCaching) {
$this->_memoryCacheAdd($this->_file, $data);
if ($this->_onlyMemoryCaching) {
return true;
}
}
if ($this->_writeControl) {
if (!$this->_writeAndControl($data)) {
@touch($this->_file, time() - 2 * abs($this->_lifeTime));
return false;
} else {
return true;
}
} else {
return $this->_write($data);
}
}
return false;
}
/** * Save the data to cache for the specified section and locale. * @param array $data The data to save. * @param string $catalogue The translation section. * @param string $culture The translation locale, e.g. "en_AU". */ public function save($data, $catalogue, $culture) { $ID = $this->getID($catalogue, $culture); $group = $this->getGroup($catalogue, $culture); //echo '## Cache save: "'.$ID.'" : "'.$group.'"'; //echo "<br>\n"; return $this->cache->save($data, $ID, $group); }