[Xapian-devel] Available backends in xapian.h

Olly Betts olly at survex.com
Wed May 4 12:30:09 BST 2005


On Wed, May 04, 2005 at 10:27:56AM +0100, Sam Liddicott wrote:
> I am guilty!

I didn't mean that as criticism, just an explanation of the situation.

> Olly, if you could remind me what you think the problem is with swig and 
> php I /will/ take a look at it tonight. My calendar is empty, which 
> bodes well.

There are three SWIG/PHP bugs/issues that are annoying for Xapian:

* If you run SWIG *without* -noproxy, the generated code segfaults.
  I've not tried this recently, but this (complete!) testcase was
  enough to demonstrate this in September 2004:

  $doc = new Document();
  $doc->add_term("a");

  The problem seems to be to do with handling of default arguments.

  Here's the whole thread where this was discussed (it wasn't all on the
  list so I can't just point to the archives).  The source SWIG generated
  at the time is in there as an attachement:
  
  http://www.survex.com/~olly/swig-php4-proxyclass-bug.mbox.gz
  
* SWIG/PHP doesn't support -prefix like TCL8 does -- if it did we'd at
  least have a primitive sort of namespace.  If we could remove -noproxy
  then you'd only need to add xapian_ in front of constructors, static
  methods, and the factory functions (with -noproxy it would probably
  feel annoyingly verbose).  We could work around not having -prefix by
  running the generated source through a simple sed script, but
  enhancing SWIG is obviously a better approach.

* As of SWIG 1.3.23, optional parameters in C++ have to be specified in
  PHP code.  This thread is relevant:

  http://thread.gmane.org/gmane.comp.search.xapian.general/1532

  In SWIG 1.3.23 there was a major reworking of how overloading was
  handled as I understand it.

  I think overloaded methods have problems too.

  (I've just realised all the SWIG PHP warnings I fixed were from a
  newer SWIG, so I need to go back and undo those changes.  Sigh.)

Cheers,
    Olly




More information about the Xapian-devel mailing list