[pmwiki-devel] When Readpage fails

Daniel Roesler diafygi at gmail.com
Fri Mar 6 14:23:36 CST 2009


Correct me if I'm wrong, but you might want to check
RetrieveAuthPage() for a response of 'null'.
<http://www.pmwiki.org/wiki/PmWiki/FunctionList>

What I use:
$page = RetrieveAuthPage($pagename, "edit");
if(!($page === null))

where you use === instead of ==, since a return of 0 or false might
still be accepted as false.

Avast!
Daniel Roesler
diafygi at gmail.com

On Fri, Mar 6, 2009 at 1:27 PM, Peter Bowers <pbowers at pobox.com> wrote:
> What is the normal way of checking whether ReadPage() has been
> unsuccessful?  (Or, by extension, RetrieveAuthPage())
>
> I see lots of this:
>
> if (!$page) ...
>
> but my reading of ReadPage() seems to indicate that a failed read will
> result in an array ('ctime' => now, 'time' => now).
>
> If I'm interpreting that correctly, then what's the preferred way to check
> if the read failed?  (I'm actually more interested in the results of
> RetrieveAuthpage() than ReadPage().)
>
> -Peter
>
> _______________________________________________
> pmwiki-devel mailing list
> pmwiki-devel at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
>
>



More information about the pmwiki-devel mailing list