Subversion Repositories Applications.framework

Compare Revisions

Ignore whitespace Rev 431 → Rev 432

/trunk/framework/CacheSimple.php
34,17 → 34,34
public function __construct($options = array()) {
extract($options);
$this->mise_en_cache = is_bool($mise_en_cache) ? $mise_en_cache : true;
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, realpath(%s) invalide [%s]",
__FILE__,
$stockage_chemin,
$_SERVER['REQUEST_URI']));
}
$this->duree_de_vie = isset($duree_de_vie) ? $duree_de_vie : 3600*24;
 
// cache inactif
if (!$this->mise_en_cache) return;
 
$this->stockage_chemin = isset($stockage_chemin) ? realpath($stockage_chemin) : Fichier::getDossierTmp();
if(!realpath($stockage_chemin)) {
error_log(sprintf("%s: Attention, %s invalide: creation [%s]",
__FILE__,
$stockage_chemin,
$_SERVER['REQUEST_URI']));
 
mkdir($stockage_chemin, 0755, TRUE);
}
if(!realpath($stockage_chemin)) {
error_log(sprintf("%s: Attention, realpath(%s) invalide [%s]",
__FILE__,
$stockage_chemin,
$_SERVER['REQUEST_URI']));
return;
}
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;
}
$this->duree_de_vie = isset($duree_de_vie) ? $duree_de_vie : 3600*24;
}
private function initialiserOptionsParConfig() {