[Xapian-discuss] Query::Query() in PHP, also QueryParser::prefixes

Francis Irving francis@flourish.org
Fri, 28 May 2004 08:46:43 +0100


On Thu, May 27, 2004 at 05:42:26PM +0100, James Aylett wrote:
> > Aha!  Thank you.  Much more success.  I've tried this.
> > 
> > %name(QueryCombine) Xapian::Query::Query(Xapian::Query::Query::op op_,
> > %const Xapian::Query::Query & left, const Xapian::Query::Query &
> > %right);
> > 
> > It makes a PHP function called query_querycombine.  Unfortunately,
> > the function takes a spurious extra Query argument as its first
> > parameter.  SWIG thinks it is a member function, rather than a
> > constructor.
> > 
> > $query = query_querycombine($querydummy, Query_OP_AND, $query1, $query2); 
> > 
> > It works though!
> 
> Weird. We should be able to get it to turn into query_new_combine()
> without the $querydummy parameter.
> 
> Hmm ... try new_QueryCombine() without the dummy parameter - it's
> possible that this won't create a shadow class, but just the internal
> wrapped class. Try it, and see what happens :)

This line:
        $query = new_QueryCombine(Query_OP_AND, $query1, $query2);
Gives this error:
    Fatal error: Call to undefined function: new_querycombine()

No other function with the word combine appears in the PHP function
list either.
  
Francis