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

Sam Liddicott sam@liddicott.com
Fri, 28 May 2004 12:23:14 +0100


----- Original Message ----- 
From: "Francis Irving" <francis@flourish.org>
To: <xapian-discuss@lists.xapian.org>
Sent: Wednesday, May 26, 2004 10:54 PM
Subject: [Xapian-discuss] Query::Query() in PHP, also QueryParser::prefixes


> Just tried to do some query building in PHP but came up against a
> brick wall.  The only constructor exposed by SWIG is the first one.
> SWIG doesn't seem to support operator overloading of constructors.

If you use swig tricks (and I forget what they are now) to give the
overloaded constructors different names, swig will still realise they are
constructors and you can invoke them as class methods in php

$new_object=Class::renamed_constructor("blah");

and still get a new instance.

I made it support the default constructor as a class method that returns a
new instance.

Sam