[Xapian-discuss] PHP MatchDecider in 1.2.0

Olly Betts olly at survex.com
Thu Jun 10 15:05:09 BST 2010


On Tue, Jun 08, 2010 at 05:49:27PM +0200, "Pl?ek Vít?zslav | Qcm s.r.o." wrote:
> I would like to ask if is possible in new version of Xapian some kind of  
> subclasing MatchDecider in PHP. I am developing application where is  
> very complex permission management. so it cannot be stored in fultext  
> database. MatchDeciders are perfect for this purpose. But I dont know if  
> is possible to use them in PHP even if SWIG now supports directors.

SWIG now supports directors for PHP, but simply enabling this for Xapian
didn't work when I tried it a while ago.  I didn't have time to investigate
back then, but I've just had another look to see what the problems are.

I found and fixed one bug in SWIG's PHP director support (it didn't handle a
directed method which had been renamed, as we do for operator() -> apply).

The only remaining issue seems to be that SWIG's PHP director support
doesn't handle directed methods which take an object as a parameter - the
subclassed method gets a PHP resource without its object wrapper.  This
doesn't seem so easy to fix, and also means that just turning on directors
breaks other classes with directed methods, so we can't just advise the
user to wrap the resource themselves to work around this in the short term.

So not great news I'm afraid.  I'll talk to Miklos Vajna who implemented
SWIG's PHP director support to see if he has a good idea for how to fix
this.

Cheers,
    Olly



More information about the Xapian-discuss mailing list