"Plšek Vítězslav | Qcm s.r.o.
2010-Jun-08 15:49 UTC
[Xapian-discuss] PHP MatchDecider in 1.2.0
Good afternoon 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. Now Iam using ValueSetMatchDecider which takes array of visible objects ids and compare them to some document value. But its not ideal, Own MatchDecider would allow me just call isVisible method on the object gathered from fultext db. If its not subclassable, is there some way to create MathDecider, where we I put at least some callback function defined in PHP? I will be glad for any suggestions Thank you for your time? Sincerely Pl?ek V?t?zslav
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