summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xactualize_script.php2
-rwxr-xr-xapp/controllers/entryController.php2
-rwxr-xr-xapp/controllers/indexController.php4
-rw-r--r--app/layout/layout.phtml2
-rwxr-xr-xapp/models/RSSConfiguration.php2
-rw-r--r--lib/lib_rss.php4
-rwxr-xr-xlib/minz/dao/Model_pdo.php2
-rwxr-xr-xpublic/index.php7
8 files changed, 15 insertions, 10 deletions
diff --git a/actualize_script.php b/actualize_script.php
index bc1d108bd..942070ccc 100755
--- a/actualize_script.php
+++ b/actualize_script.php
@@ -20,4 +20,4 @@ $front_controller = new App_FrontController ();
$front_controller->init ();
Session::_param('mail', true); // permet de se passer de la phase de connexion
$front_controller->run ();
-touch(DATA_PATH . '/touch.txt');
+invalidateHttpCache();
diff --git a/app/controllers/entryController.php b/app/controllers/entryController.php
index fa34ad429..d92eb0ed3 100755
--- a/app/controllers/entryController.php
+++ b/app/controllers/entryController.php
@@ -84,7 +84,7 @@ class entryController extends ActionController {
$entryDAO = new EntryDAO();
$entryDAO->optimizeTable();
- touch(DATA_PATH . '/touch.txt');
+ invalidateHttpCache();
$notif = array (
'type' => 'good',
diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php
index e4462e543..8e6abd682 100755
--- a/app/controllers/indexController.php
+++ b/app/controllers/indexController.php
@@ -272,7 +272,7 @@ class indexController extends ActionController {
$res = json_decode ($result, true);
if ($res['status'] == 'okay' && $res['email'] == $this->view->conf->mailLogin ()) {
Session::_param ('mail', $res['email']);
- touch(DATA_PATH . '/touch.txt');
+ invalidateHttpCache();
} else {
$res = array ();
$res['status'] = 'failure';
@@ -285,6 +285,6 @@ class indexController extends ActionController {
public function logoutAction () {
$this->view->_useLayout (false);
Session::_param ('mail');
- touch(DATA_PATH . '/touch.txt');
+ invalidateHttpCache();
}
}
diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml
index c53b28841..9b502275c 100644
--- a/app/layout/layout.phtml
+++ b/app/layout/layout.phtml
@@ -32,7 +32,7 @@
<?php
if (isset ($this->notification)) {
- touch(DATA_PATH . '/touch.txt');
+ invalidateHttpCache();
?>
<div class="notification <?php echo $this->notification['type']; ?>">
<?php echo $this->notification['content']; ?>
diff --git a/app/models/RSSConfiguration.php b/app/models/RSSConfiguration.php
index c36548e6f..fe6cd48d3 100755
--- a/app/models/RSSConfiguration.php
+++ b/app/models/RSSConfiguration.php
@@ -473,6 +473,6 @@ class RSSConfigurationDAO extends Model_array {
}
$this->writeFile($this->array);
- touch(DATA_PATH . '/touch.txt');
+ invalidateHttpCache();
}
}
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 3c03f4281..5a74bfd0a 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -230,3 +230,7 @@ function lazyimg($content) {
$content
);
}
+
+function invalidateHttpCache() {
+ file_put_contents(DATA_PATH . '/touch.txt', microtime(true));
+}
diff --git a/lib/minz/dao/Model_pdo.php b/lib/minz/dao/Model_pdo.php
index 545f59e81..48c81d082 100755
--- a/lib/minz/dao/Model_pdo.php
+++ b/lib/minz/dao/Model_pdo.php
@@ -85,7 +85,7 @@ class Model_pdo {
class FreshPDO extends PDO {
private static function check($statement) {
if (preg_match('/^(?:UPDATE|INSERT|DELETE)/i', $statement)) {
- touch(DATA_PATH . '/touch.txt');
+ invalidateHttpCache();
}
}
diff --git a/public/index.php b/public/index.php
index 9bf4fc073..cabd836d5 100755
--- a/public/index.php
+++ b/public/index.php
@@ -27,10 +27,11 @@ if (file_exists ('install.php')) {
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
+ @filemtime(DATA_PATH . '/touch.txt'),
+ @filemtime(LOG_PATH . '/application.log'),
+ @filemtime(DATA_PATH . '/application.ini')
);
+ $_SERVER['QUERY_STRING'] .= '&utime=' . file_get_contents(DATA_PATH . '/touch.txt');
if (httpConditional($dateLastModification, 0, 0, false, false, true)) {
exit(); //No need to send anything
}