PageRegenerate
Questions answered by this recipe
Description
Make PmWiki regenerate a page, as if someone had done an edit+save sequence.
Installation
Add to your config.php file:
if ($action == 'regen') { $action = 'edit'; $EnablePmToken = 0; $_POST = array('post'=>'1'); }
Executing ?action=regen on any page will cause PmWiki to regenerate the page, as if someone had done an edit+save sequence.
Release Notes
See Also
Contributors
Comments
This works well when you have only a handful of pages to regenerate, but what happens when you mass update several (in my case, all) or your pages and have to regenerate everything? Simply doing something like:
cd .../wiki.d for f in * ; do curl http://www.example.com/wiki/pmwiki.php?n=$f&action=regen > /dev/null done
doesn't work when some or all of the pages are edit locked? — tamouse July 15, 2012, at 05:20 AM
You could either log in via the curl/wget script before editing, or temporarily unlock the wiki while you regenerate it. --Petko July 15, 2012, at 06:25 AM
if ($action == 'regen')
{ unset($DefaultPasswords
['edit']); $action = 'edit'; ... }
cd .../wiki.d curl -c /tmp/cookies.txt -d 'authid=<user>&authpw=<pass>&submit=Go' 'http://www.example.com/wiki/pmwiki.php?action=login' for f in * ; do curl -b /tmp/cookies.txt "http://www.example.com/wiki/pmwiki.php?n=$f&action=regen" > /dev/null done rm /tmp/cookies.txt
I ran this on my staging wiki and it worked a treat. Exactly what I needed. I prefer this method to modifying
local/config.php
User notes +1: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.