public function save($data,
$id,
$tags = array
(),
$specificLifetime = false,
$priority = 8
) { $usage =
$this->
_getFastFillingPercentage('saving'
);
$boolFast = true;
$lifetime =
$this->
getLifetime($specificLifetime);
$preparedData =
$this->
_prepareData($data,
$lifetime,
$priority);
if (($priority > 0
) && (10 *
$priority >=
$usage)) { $fastLifetime =
$this->
_getFastLifetime($lifetime,
$priority);
$boolFast =
$this->_fastBackend->
save($preparedData,
$id, array
(),
$fastLifetime);
$boolSlow =
$this->_slowBackend->
save($preparedData,
$id,
$tags,
$lifetime);
} else { $boolSlow =
$this->_slowBackend->
save($preparedData,
$id,
$tags,
$lifetime);
if ($boolSlow === true
) { $boolFast =
$this->_fastBackend->
remove($id);
if (!
$boolFast && !
$this->_fastBackend->
test($id)) { // some backends return false on remove() even if the key never existed. (and it won't if fast is full)
// all we care about is that the key doesn't exist now
$boolFast = true;
} }