00863: Issue with pageindex not removing files that don't exist

Summary: Issue with pageindex not removing files that don't exist
Created: 2007-01-14 14:38
Status: Open
Category: CoreCandidate
From: Azbok?
Assigned:
Priority: 3
Version: 2.2.0 beta 16
OS:

Description: I dunno if this is the proper way to contribute or not, at least I tried :)

In the pagelist.php file in the PageIndexUpdate() function I made 2 changes:

  global $PageIndexFile, $PageIndexTime, $Now, $WikiDir;

1) Added in the $WikiDir global object.


foreach($pagelist as $pn) {

    if (time() > $timeout) break;

    # If the file to be indexed doesn't exist anymore, don't include it in the pageindex file
    if (file_exists($WikiDir->pagefile($pn)) == false) {
      $updated[$pn]++;
      continue;
    }

    $page = ReadPage($pn, READPAGE_CURRENT);

2) I added in the file_exists if statement in the first loop. By doing it this way, if the PageIndexUpdate() function is called with nonexistant pages, it checks and then sets it as updated. In the next loop, since it's updated it skips it and hence not added into the pageindex file.

This update can be used with the page renamer update that I made which I'll post in another ticket.

Hope you guys can make use of this azbok