67,7 → 67,8 |
*/ |
protected $metadonnees = array(); |
|
|
private $Cache = null; |
|
/** |
* Constructor |
* |
75,7 → 76,8 |
* @throws Zend_Cache_Exception |
* @return void |
*/ |
public function __construct(array $options = array()) { |
public function __construct(array $options = array(), Cache $cache) { |
$this->Cache = $cache; |
$this->setOptions($options); |
|
if (isset($this->options['prefixe_fichier'])) { |
195,7 → 197,7 |
$metadonnees = array( |
'hash' => $cle_secu, |
'mtime' => time(), |
'expiration' => $this->getTimestampExpiration($duree_vie_specifique), |
'expiration' => $this->Cache->getTimestampExpiration($duree_vie_specifique), |
'tags' => $tags |
); |
|
697,19 → 699,6 |
} |
|
/** |
* Compute & return the expire time |
* |
* @return int expire time (unix timestamp) |
*/ |
protected function getTimestampExpiration($duree_de_vie) { |
if ($duree_de_vie === false) { |
$duree_de_vie = 3600; |
} |
$timestamp = ($duree_de_vie === null) ? 9999999999 : (time() + $duree_de_vie); |
return $timestamp; |
} |
|
/** |
* Make a control key with the string containing datas |
* |
* @param string $data Data |