[Xapian-discuss] PHP bindings

Olly Betts olly at survex.com
Wed Oct 4 16:39:54 BST 2006


On Tue, Oct 03, 2006 at 01:51:33PM +0200, Daniel M?nard wrote:
> Looking at the latest wrapper source from 
> http://www.oligarchy.co.uk/xapian/trunk/ , I don't see anything which 
> could be considered as global namespace contamination, excepted a small 
> $ext variable at the begining which could be eliminated.

Hmm yes, that shouldn't just be $ext.

> BTW: I'm not sure at all that trying to dl() the extension in the 
> wrapper if it is not loaded is a good thing... It is useful to pass the 
> smoketest, but is it for anything else?

The smoketest doesn't actually rely on that code - it does much the same
thing itself.

This code is useful if you don't want to (or can't) add xapian to the
list of extensions loaded by default.  I don't know if that's a common
scenario or not.  If you don't have root access, you may still be able
to build the xapian php bindings for example.

Incidentally, this code isn't something I've added myself - SWIG's PHP
bindings did this before I interfered, though I have rejigged the code
to work on platforms which don't use "so" for modules.  So removing it
wouldn't just affect Xapian.  Sam may know more about the history of
this.

> If we target PHP5, they can even be improved in the future, perhaps
> adding some SPL interfaces (e.g. native iterators) or things like type
> hinting in arguments lists. If we must also support PHP4 OO, we won't
> be able to add these kinds of things.

The PHP4 OO is implemented in a totally different way (use zend api
calls from C++ code) so there's no problem with a PHP4 OO API "dragging
down" the PHP5 API.

Cheers,
    Olly



More information about the Xapian-discuss mailing list