[pmwiki-users] PageLists of database contents

Patrick R. Michaud pmichaud at pobox.com
Wed Oct 4 17:22:57 CDT 2006


On Wed, Oct 04, 2006 at 10:54:45PM +0100, Américo Albuquerque wrote:
> Patrick R. Michaud wrote:
> (...)
> >
> >Well, this is why there's a "1." in front of my "Create a custom
> >PageStore object ..." step above.  Step "2." is to get MakePageList
> >to be able to determine the set of pages without having
> >to call the ls() method.   :-)
> >
> Can MakePageList be changed? is it called by a variable, like other 
> functions in pmwiki?

It's called by functions that are called by variables, so it
could be changed "one-level-removed".  I can make it into
a variable name if anyone needs it to be so.

> >Note that you've now literally reached the bleeding edge of PmWiki 
> >core development-- the hooks to allow custom inputs and filters to 
> >MakePageList didn't even exist in PmWiki as of a week ago.  But that's
> >really a good thing, as it's always better to have real implementation
> >issues at hand when doing design and development.
> >
> Is there any page where we can get this info? Like, what do I need to 
> change the storage of pages, what do I need to change page names 
> schematic, group names, etc?

The PageStore class in pmwiki.php is the place to look.  It's
really not hard to follow -- the methods are pretty straightforward.


> >The key to making this more efficient will be to reduce the
> >overall number of "pages" (records) that MakePageList has to perform 
> >its searches on.   I'm thinking the best approach to this will
> >be for us to provide either (1) options to ListPages() and ls()
> >or (2) alternate methods entirely so that we can tell a 
> >PageStore/DataStore object "we want the names of 'pages' that
> >might match these criteria" as opposed to "give me a list of
> >all pages".  Then we can optimize things quite a bit.
> >
> How does the search work? does it use a function for each action or does 
> it have a search function? A workaround would be to make a special 
> "search" function for that particular DataStore

Essentially was I was writing above was to convert the existing
ListPages() function into a more general "return pages that
may match these criteria" function.  We'd have to come up with
conventions for the criteria, but that's not too difficult.

> >I'm also needing to re-think a few of PmWiki's internals here,
> >especially the $PCache array.  
>
> What does $PCache saves? the entire page array?

It currently saves everything except the page text and 
the page history.  In using $PCache I'm quite concerned
about hitting PHP memory limits, so I want to be sparing
in terms of what gets stored in the cache, and use it
only when it's likely that not using it would result in
extra I/O.

But on the other hand I'm not entirely happy with how it
currently works, so I'm looking for other designs.

Pm




More information about the pmwiki-users mailing list