Subversion Repositories Applications.framework

Rev

Rev 434 | Rev 437 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 434 Rev 436
Line 14... Line 14...
14
 * @author		Aurélien PERONNET <aurelien@tela-botanica.org>
14
 * @author		Aurélien PERONNET <aurelien@tela-botanica.org>
15
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
15
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
16
 * @license	http://framework.zend.com/license/new-bsd Licence New BSD
16
 * @license	http://framework.zend.com/license/new-bsd Licence New BSD
17
 * @license	http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
17
 * @license	http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
18
 * @license	http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
18
 * @license	http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
19
 * @version	$Id: CacheSimple.php 434 2013-09-04 14:28:46Z jpm $
19
 * @version	$Id: CacheSimple.php 436 2013-09-17 14:27:57Z raphael $
20
 * @link		/doc/framework/
20
 * @link		/doc/framework/
21
 */
21
 */
22
// TODO : voir ce qui est le plus pratique : error_log ou le gestionnaire de bogue du framework
22
// TODO : voir ce qui est le plus pratique : error_log ou le gestionnaire de bogue du framework
23
class CacheSimple {
23
class CacheSimple {
Line 108... Line 108...
108
 
108
 
109
				$fh = fopen($chemin_fichier_cache,'w+');
109
				$fh = fopen($chemin_fichier_cache,'w+');
110
				if ($fh) {
110
				if ($fh) {
111
					if (fwrite($fh, $contenu)) {
111
					if (fwrite($fh, $contenu)) {
-
 
112
						if (fclose($fh)) {
-
 
113
							error_log(sprintf("%s: caching \"%s\" [%s]", __FILE__, $chemin_fichier_cache, $_SERVER['REQUEST_URI']));
112
						if (fclose($fh)) {
114
 
113
							$ok = true;
115
							$ok = true;
114
						}
116
						}
115
					}
117
					}
116
					// Voir #ZF-4422 pour la raison de l'utilisation de octdec()
118
					// Voir #ZF-4422 pour la raison de l'utilisation de octdec()
117
					@chmod($chemin_fichier_cache,  octdec('0777'));
119
					@chmod($chemin_fichier_cache,  octdec('0777'));
118
				}
120
				}
119
			}
121
			}
-
 
122
		}
120
		}
123
		if(!$ok) error_log(sprintf("%s: ERROR trying to cache \"%s\" [%s]", __FILE__, $chemin_fichier_cache, $_SERVER['REQUEST_URI']));
121
		return $ok;
124
		return $ok;
122
	}
125
	}
123
}
126
}
124
?>
127
?>