On Fri, Mar 06, 2009 at 08:27:42PM +0100, Peter Bowers 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().)
RetrieveAuthPage() returns false if the current visitor doesn't have authorization to view a given page, otherwise it returns the page that it read. PmWiki doesn't consider reading a non-existent page to be a "failure" -- non-existent pages are simply treated as being empty. To check for a page's existence, use PageExists() . Pm _______________________________________________ pmwiki-devel mailing list pmwiki-devel@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-devel