|
Cookbook /
PageRegenerateSummary: Make PmWiki regenerate a page, as if someone had done an edit+save sequence.
Version: 1.0
Prerequisites: None.
Status: Stable
Maintainer: Anno
Categories: Administration
Questions answered by this recipe
DescriptionMake PmWiki regenerate a page, as if someone had done an edit+save sequence. NotesAdd to your config.php file: if ($action == 'regen')
{ $action = 'edit'; $_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 Alsohttp://article.gmane.org/gmane.comp.web.wiki.pmwiki.user/42595 ContributorsCommentsThis 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(Thanks, Petko. I investigated the first option, and found it ridiculously simple:
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
where <user> is user login name, <pass> is their password. 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
— tamouse July 15, 2012, at 02:48 PM
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. |