summaryrefslogtreecommitdiff
path: root/lib/exe/indexer.php
diff options
context:
space:
mode:
authorGuy Brand <gb@unistra.fr>2015-08-10 10:03:27 +0200
committerGuy Brand <gb@unistra.fr>2015-08-10 10:03:27 +0200
commit53a57d16b9c741bb44099fd93bf79efa06796341 (patch)
tree24a90a50afe9325926c8ebaa2ed90f9fa093e5b9 /lib/exe/indexer.php
parentcf6e6645c31a9f185cef3fb9452fb188882ede47 (diff)
parenta060d9973e7c1d5051f2cc426937881826e4972e (diff)
downloadrpg-53a57d16b9c741bb44099fd93bf79efa06796341.tar.gz
rpg-53a57d16b9c741bb44099fd93bf79efa06796341.tar.bz2
Merge branch master into stable
Diffstat (limited to 'lib/exe/indexer.php')
-rw-r--r--lib/exe/indexer.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php
index 3ab117736..d2a4d45f7 100644
--- a/lib/exe/indexer.php
+++ b/lib/exe/indexer.php
@@ -51,8 +51,9 @@ exit;
/**
* Trims the recent changes cache (or imports the old changelog) as needed.
*
- * @param media_changes If the media changelog shall be trimmed instead of
- * the page changelog
+ * @param bool $media_changes If the media changelog shall be trimmed instead of
+ * the page changelog
+ * @return bool
*
* @author Ben Coburn <btcoburn@silicodon.net>
*/
@@ -67,9 +68,9 @@ function runTrimRecentChanges($media_changes = false) {
// Trims the recent changes cache to the last $conf['changes_days'] recent
// changes or $conf['recent'] items, which ever is larger.
// The trimming is only done once a day.
- if (@file_exists($fn) &&
+ if (file_exists($fn) &&
(@filemtime($fn.'.trimmed')+86400)<time() &&
- !@file_exists($fn.'_tmp')) {
+ !file_exists($fn.'_tmp')) {
@touch($fn.'.trimmed');
io_lock($fn);
$lines = file($fn);
@@ -83,7 +84,7 @@ function runTrimRecentChanges($media_changes = false) {
io_saveFile($fn.'_tmp', ''); // presave tmp as 2nd lock
$trim_time = time() - $conf['recent_days']*86400;
$out_lines = array();
-
+ $old_lines = array();
for ($i=0; $i<count($lines); $i++) {
$log = parseChangelogLine($lines[$i]);
if ($log === false) continue; // discard junk
@@ -198,7 +199,7 @@ function sendGIF(){
header('Content-Length: '.strlen($img));
header('Connection: Close');
print $img;
- flush();
+ tpl_flush();
// Browser should drop connection after this
// Thinks it's got the whole image
}