[Xapian-discuss] PHP Binding and SWIG Director for XapianMatchDecider

Olly Betts olly at survex.com
Wed Feb 16 12:30:37 GMT 2011


On Fri, Feb 11, 2011 at 05:55:30PM +0100, Yoann Maheo wrote:
> I try to use XapianMatchDecider to filtering results, but the code :
> $Decider = new MatchDecider_Search($XapianDatabase->_cPtr);

You shouldn't be accessing _cPtr explicitly yourself - it's a SWIG
implementation detail, and might change in the future.

> $mset = $XapEnquire->get_mset(0, 3000, null, $Decider);
>
> Always return :
> PHP Fatal error:  No matching function for overloaded 'Enquire_get_mset'  
> in xapian.php on line 1082

This doesn't work because subclassing Xapian classes in PHP isn't
currently supported, so your $Decider object isn't a XapianMatchDecider
as far as SWIG is concerned.

> I saw that SWIG was not supporting Directors for PHP, but now, it seems  
> to be patched.

SWIG now supports it, but I've not yet managed to get this to work with
Xapian.  This is the ticket:

http://trac.xapian.org/ticket/488

> Why is it still not working ? Do you have a work arround ?

Sorry, there isn't really a workaround, other than avoid needing to
subclass MatchDecider, etc, or use a different language instead of PHP.

On Sat, Feb 12, 2011 at 02:15:23PM +0100, Yoann Maheo wrote:
> "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."

> I would like to know if this bug is fixed and if PHP Director can be  
> actived in Xapian binding.

As far as I'm aware, this isn't fixed yet.

Cheers,
    Olly



More information about the Xapian-discuss mailing list