[pmwiki-devel] UpdatePage() and warnings
Crisses
crisses at kinhost.org
Wed Nov 8 07:17:57 CST 2006
On Nov 8, 2006, at 6:04 AM, Petko Yotov wrote:
>>> So, how can I postpone the UpdatePage() call after the markup
>>> rules are
>>> loaded?.
> ...
>>
>> function SwapPages($dir = NULL) {
>> // disable for testing!!
>> // ignore_user_abort();
>> if ($dir) { flush(); chdir($dir); }
>> foreach($MyListOfPages as $mypage)
>> {
>> CopyPageText($mypage, 'Main.INBOX');
>> }
>> touch("$WorkDir/.textcopied");
>> ...
>> }
Oops -- in my sample function I didn't
global $WorkDir, $MyListOfPages; // ....etc.
so keep in mind that you will need to pull in any variables you need
to the function or pass them as additional parameters through the
register_shutdown_function
> Thank you for your answers, Crisses. I read your message yesterday
> but I
> actually wish this to be done automatically, without anyone having to
> call .../pmwiki.php?action=copy.
I saw that afterwards, so I reposted with the corrections. I wasn't
trying to 100% solve the issue, but to give you a few ideas on how to
go about it.
> I'll see if it can be done with register_shutdown_function(),
> otherwise, I
> have safe_mode so ignore_user_abort() will not work. Anyway, there
> will be
> usually one only page to copy per day which is fast, and there is
> no need to
> ignore_user_abort(), unless there are no visits for months.
If it's a public URL, it's pretty unlikely.
> Thanks for your kind comments, I'll test it tonight and will tell
> you if it
> worked.
Thanks!!
Crisses
More information about the pmwiki-devel
mailing list