From e0c26282a603881e8d2f839d94c28dbbfc57d71b Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 03:34:17 +0200 Subject: scrutinizer documentations issues --- lib/exe/indexer.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/exe/indexer.php') diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 3ab117736..d0a5e0463 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 */ -- cgit v1.2.3 From 59bc3b48fdffb76ee65a4b630be3ffa1f6c20c80 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 21:45:27 +0200 Subject: more scrutinizer issue improvements --- lib/exe/indexer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/exe/indexer.php') diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index d0a5e0463..89c4b7cd0 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -84,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 Date: Wed, 7 Jan 2015 10:47:45 +0100 Subject: Remove error supression for file_exists() In an older version of PHP a file_exists() call would issue a warning when the file did not exist. This was fixed in later PHP releases. Since we require PHP 5.3 now, there's no need to supress any error here anymore. This might even give a minor performance boost. --- lib/exe/indexer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/exe/indexer.php') diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 89c4b7cd0..330b8498d 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -68,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) Date: Thu, 5 Feb 2015 15:37:31 +1100 Subject: Add ob_flush() to sendGIF I'm running this dokuwiki docker container: https://registry.hub.docker.com/u/mprasil/dokuwiki/ It uses lighttpd and fastcgi. For some reason, the ignore_user_abort() feature where the browser should close the connection after the GIF has been received is not working on lighty. The browser keeps loading the page until the indexer run is complete, which leads to extremely slow load times with a larger page index. Adding ob_flush() to sendGIF fixes the issue. --- lib/exe/indexer.php | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/exe/indexer.php') diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 330b8498d..2de178caa 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -199,6 +199,7 @@ function sendGIF(){ header('Content-Length: '.strlen($img)); header('Connection: Close'); print $img; + ob_flush(); flush(); // Browser should drop connection after this // Thinks it's got the whole image -- cgit v1.2.3 From e13bd5dcd000cc82ed5f1379dac0d674789d3a0c Mon Sep 17 00:00:00 2001 From: Christoph Dwertmann Date: Tue, 17 Mar 2015 18:22:29 +1100 Subject: Speed up indexer on lighttpd by using tpl_flush() --- lib/exe/indexer.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/exe/indexer.php') diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 2de178caa..d2a4d45f7 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -199,8 +199,7 @@ function sendGIF(){ header('Content-Length: '.strlen($img)); header('Connection: Close'); print $img; - ob_flush(); - flush(); + tpl_flush(); // Browser should drop connection after this // Thinks it's got the whole image } -- cgit v1.2.3