[Pmwiki-users] PmWikiDataStore - Using a class for page file i/o.

Patrick R. Michaud pmichaud
Mon Mar 22 00:09:24 CST 2004


On Sun, Mar 21, 2004 at 10:55:02PM -0800, Greg Morgan wrote:
> 
>    It's  funny.. in my head it actually smplifies things.  I re-wrote the
>    existing ReadPage, WritePage functions to use the class.. so as far as
>    the  rest of PmWiki is concerned nothing changed.  The addition of the
>    PageList  method  makes  writing  code  that needs to act on all pages
>    easier to impliment.

I agree there needs to be a PageList function--I was actually planning
to write one (but would've probably called it something else--most of
my other function names begin with verbs, although PageExists is a notable
exception).  

> Isn't there a way to write some XML-RPC glue to call HandlePost
> with the needed information rather than having to duplicate it?
> Or, I could abstract the relevant details of HandlePost into a
> separate function that's more easily called by an XML-RPC handler.
> 
>    handlepost  uses  $_POST  array quite a bit.  While I might be able to
>    populate  all  of  the  global variables needed to use the handle_post
>    function, it seemed kind of clunky to me.

I agree, which is why it might be worthwhile to abstract it to a
PostPage function, with HandlePost filling in the relevant variables
from $_POST and an XML-RPC filling in the variables from its function.

I'm not sure that HandlePost (or PostPage) belong in a storage 
class/object, to me it seems it ought to be somehow independent 
of the storage mechanism being used, or that it's at a slightly
higher layer of abstraction than the other methods.

Pm



More information about the pmwiki-users mailing list