Annulation du cache via no-cache.txt

La présence du fichier DATA_PATH/no-cache.txt permet de désactiver le
cache. Ce fichier n'est pas présent par défaut

Corrige #297
This commit is contained in:
Marien Fressinaud
2013-11-28 16:37:27 +01:00
parent e3fc889e51
commit dc2e1dc081
2 changed files with 12 additions and 9 deletions

3
data/.gitignore vendored
View File

@@ -1,4 +1,5 @@
application.ini
*_user.php
*.sqlite
touch.txt
touch.txt
no-cache.txt

View File

@@ -24,14 +24,16 @@ if (file_exists ('install.php')) {
require('../constants.php');
session_cache_limiter('');
require (LIB_PATH . '/http-conditional.php');
$dateLastModification = max(
@filemtime(DATA_PATH . '/touch.txt') - 1,
@filemtime(LOG_PATH . '/application.log') - 1,
@filemtime(DATA_PATH . '/application.ini') - 1
);
if (httpConditional($dateLastModification, 0, 0, false, false, true)) {
exit(); //No need to send anything
if (!file_exists(DATA_PATH . '/no-cache.txt')) {
require (LIB_PATH . '/http-conditional.php');
$dateLastModification = max(
@filemtime(DATA_PATH . '/touch.txt') - 1,
@filemtime(LOG_PATH . '/application.log') - 1,
@filemtime(DATA_PATH . '/application.ini') - 1
);
if (httpConditional($dateLastModification, 0, 0, false, false, true)) {
exit(); //No need to send anything
}
}
set_include_path (get_include_path ()