[pmwiki-users] Markup engine global improvement

John Rankin john.rankin at affinity.co.nz
Wed Jul 6 19:17:25 CDT 2005


On Thursday, 7 July 2005 2:55 AM, Joachim Durchholz <jo at durchholz.org> wrote:
>Patrick R. Michaud wrote:
>
>> On Wed, Jul 06, 2005 at 04:19:49PM +0200, Joachim Durchholz wrote:
>> 
>>> It turned out that the class is missing an important abstraction,
>>> namely page renames. Writing a variation of that class would break
>>> at least the Rename recipe.
>> 
>> Why do you claim this?  AFAICT the rename recipe uses ReadPage() and 
>> WritePage(), the same as the rest of PmWiki (and as it should).  
>> The generic approach for renaming a page is
>> 
>>     function RenamePage($oldname, $newname) {
>>       global $WikiDir;
>>       $page = ReadPage($oldname);            # read old page
>>       WritePage($newname, $page);            # save with new name
>>       $WikiDir->delete($oldname);            # remove old page
>>     }
>> 
>> and this should work with any PageStore instance.
>
>The Rename recipe may have been updated since, but last time I looked, 
>pages were renamed at the file level. The recipe even had an explicit 
>warning that it would work only with the standard page store (that's how 
>I became aware of the issue in the first place).

It has indeed been updated so that it uses only ReadPage and WritePage.
It doesn't remove the old page; rather it redirects to the new page, so
existing links continue to work. It also has an option to qualify any
unqualified links when one renames a page into a different group, so
links to pages in the original group still work, if desired.


-- 
JR
--
John Rankin






More information about the pmwiki-users mailing list