Skip to content

Commit

Permalink
[#315579] do not use getPagesList() to get the number of pages
Browse files Browse the repository at this point in the history
  • Loading branch information
wkpark committed Aug 10, 2010
1 parent 9b5248f commit 0ee14c6
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions wiki.php
Expand Up @@ -905,7 +905,7 @@ function getPageLists($options=array()) {
if (is_array($list)) return $list;
}

if (!empty($this->use_indexer)) {
if (0 and !empty($this->use_indexer)) {
include_once("lib/indexer.DBA.php");
$indexer = new Indexer_dba('fullsearch', 'r', $this->dba_type);
if ($indexer->db) {
Expand Down Expand Up @@ -978,9 +978,22 @@ function getLikePages($needle,$count=100,$opts='') {

function getCounter() {
$pc = new Cache_text('pagelist');
if ($pc->exists('counter'))
if (filemtime($this->text_dir) < $pc->mtime('counter') and $pc->exists('counter'))
return $pc->fetch('counter');
return sizeof($this->getPageLists());

$handle = opendir($this->text_dir);
if (!is_resource($handle))
return 0;

$count = 0;
while (($file = readdir($handle)) !== false) {
if (is_dir($this->text_dir."/".$file)) continue;
$count++;
}
closedir($handle);

$pc->update('counter', $count);
return $count;
}

function addLogEntry($page_name, $remote_name,$comment,$action="SAVE") {
Expand Down

0 comments on commit 0ee14c6

Please sign in to comment.