00694: use page in wikilib.d instead of wiki.d if newer

Summary: use page in wikilib.d instead of wiki.d if newer
Created: 2006-03-09 01:17
Status: Closed - declined
Category: Feature
From: MarcioRPS
Priority: 3
Version: 2.1-beta

Description: function ReadPage() just picks the first page it finds (kinda, didn't understand it very well...).

It woud be very handy to me if I could make ReadPage choose the newer version of a file instead of just giving preference to the one in the wiki.d.

I do have an online wiki and a local one, and do work on both, so it would be great to be able to just copy everything in one wiki.d to the other's wikilib.d, and let pmwiki pick the newest version.

(Just a note: the commentary just above ReadPage refers to $WikiReadDirsFmt which I believe is now WikiLibDirs...)

You probably don't want to be copying files from wiki.d into wikilib.d. Copy the files into wiki.d, or if that doesn't work then create a separate remote.d/ directory for holding the copied files and use that:

    $WikiLibDirs = array(
      new PageStore('remote.d/PITS.00694'),
      new PageStore('$FarmD/wikilib.d/PITS.00694'));

Then you can copy files into remote.d/ and not have to worry about interferences from wikilib.d/ .

As far as having PmWiki choose the most recent -- that's not a good idea. If PmWiki were to choose the most recent of wiki.d/ and wikilib.d/, then anytime someone upgrades PmWiki the distribution files could end up getting used instead of the locally modified versions.

Most FTP utilities have a "copy only if newer" feature that would seem to make more sense. And, using the remote.d/ scheme above, it wouldn't be hard to have a script go through the pages of each directory, removing the wiki.d/ copy of the page if there's a newer version in remote.d/ .