19,6 → 19,7 |
* @version $Id$ |
* @link /doc/framework/ |
*/ |
// TODO : voir ce qui est le plus pratique : error_log ou le gestionnaire de bogue du framework |
class CacheSimple { |
|
private $mise_en_cache = null; |
35,9 → 36,7 |
extract($options); |
$this->mise_en_cache = is_bool($mise_en_cache) ? $mise_en_cache : true; |
|
// cache inactif |
if (!$this->mise_en_cache) return; |
|
if ($this->mise_en_cache) { |
$this->stockage_chemin = isset($stockage_chemin) ? realpath($stockage_chemin) : Fichier::getDossierTmp(); |
if(!realpath($stockage_chemin)) { |
error_log(sprintf("%s: Attention, %s invalide: creation [%s]", |
44,7 → 43,6 |
__FILE__, |
$stockage_chemin, |
$_SERVER['REQUEST_URI'])); |
|
mkdir($stockage_chemin, 0755, TRUE); |
} |
if(!realpath($stockage_chemin)) { |
52,17 → 50,16 |
__FILE__, |
$stockage_chemin, |
$_SERVER['REQUEST_URI'])); |
return; |
} |
else if(!is_writable(realpath($stockage_chemin))) { |
} else if(!is_writable(realpath($stockage_chemin))) { |
error_log(sprintf("%s: Attention, realpath(%s) non-inscriptible [%s]", |
__FILE__, |
realpath($stockage_chemin), |
$_SERVER['REQUEST_URI'])); |
return; |
} |
} else { |
$this->duree_de_vie = isset($duree_de_vie) ? $duree_de_vie : 3600*24; |
} |
} |
} |
|
private function initialiserOptionsParConfig() { |
while (list($nom, $valeur) = each($this->options)) { |