diff options
-rw-r--r-- | inc/infoutils.php | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/inc/infoutils.php b/inc/infoutils.php index fe312d13f..a124e2c95 100644 --- a/inc/infoutils.php +++ b/inc/infoutils.php @@ -60,7 +60,7 @@ function getVersionData(){ //import version string if(file_exists(DOKU_INC.'VERSION')){ //official release - $version['date'] = trim(io_readfile(DOKU_INC.'VERSION')); + $version['date'] = trim(io_readFile(DOKU_INC.'VERSION')); $version['type'] = 'Release'; }elseif(is_dir(DOKU_INC.'.git')){ $version['type'] = 'Git'; @@ -249,18 +249,41 @@ function check(){ } } - if ($index_corrupted) - msg('The search index is corrupted. It might produce wrong results and most + if($index_corrupted) { + msg( + 'The search index is corrupted. It might produce wrong results and most probably needs to be rebuilt. See <a href="http://www.dokuwiki.org/faq:searchindex">faq:searchindex</a> - for ways to rebuild the search index.', -1); - elseif (!empty($lengths)) + for ways to rebuild the search index.', -1 + ); + } elseif(!empty($lengths)) { msg('The search index seems to be working', 1); - else - msg('The search index is empty. See + } else { + msg( + 'The search index is empty. See <a href="http://www.dokuwiki.org/faq:searchindex">faq:searchindex</a> for help on how to fix the search index. If the default indexer - isn\'t used or the wiki is actually empty this is normal.'); + isn\'t used or the wiki is actually empty this is normal.' + ); + } + + // rough time check + $http = new DokuHTTPClient(); + $http->max_redirect = 0; + $http->timeout = 3; + $http->sendRequest('http://www.dokuwiki.org', '', 'HEAD'); + $now = time(); + if(isset($http->resp_headers['date'])) { + $time = strtotime($http->resp_headers['date']); + $diff = $time - $now; + + if(abs($diff) < 4) { + msg("Server time seems to be okay. Diff: {$diff}s", 1); + } else { + msg("Your server's clock seems to be out of sync! Consider configuring a sync with a NTP server. Diff: {$diff}s"); + } + } + } /** |