summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorRobert Nitsch <r.s.nitsch@gmail.com>2012-05-21 19:43:03 +0200
committerRobert Nitsch <r.s.nitsch@gmail.com>2012-05-21 19:43:03 +0200
commitc07c5d9357d0e1796b24abac74d9628b41098242 (patch)
tree0d9cfd75de801c9eadb000fce45104a49aef09f9 /inc
parent5a9866e97863490816d932e98e8e170e49405d43 (diff)
downloadrpg-c07c5d9357d0e1796b24abac74d9628b41098242.tar.gz
rpg-c07c5d9357d0e1796b24abac74d9628b41098242.tar.bz2
Fixes messages.txt's modification timestamp not being updated.
This bug occurs on systems where writing a zero-length string to an empty file does not update the file's modification timestamp. This leads to the messages.txt being downloaded almost endlessly, causing long delays for logged-in users. Visitors are not affected, because the messages.txt is only updated for logged-in users.
Diffstat (limited to 'inc')
-rw-r--r--inc/infoutils.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/inc/infoutils.php b/inc/infoutils.php
index 2b8486906..ff752cd0f 100644
--- a/inc/infoutils.php
+++ b/inc/infoutils.php
@@ -25,11 +25,14 @@ function checkUpdateMessages(){
// check if new messages needs to be fetched
if($lm < time()-(60*60*24) || $lm < @filemtime(DOKU_INC.DOKU_SCRIPT)){
+ dbglog("checkUpdatesMessages(): downloading messages.txt");
$http = new DokuHTTPClient();
$http->timeout = 8;
$data = $http->get(DOKU_MESSAGEURL.$updateVersion);
io_saveFile($cf,$data);
+ @touch($cf);
}else{
+ dbglog("checkUpdatesMessages(): messages.txt up to date");
$data = io_readFile($cf);
}