[Xapian-discuss] PHP bindings

James Aylett james-xapian@tartarus.org
Wed, 26 May 2004 10:16:13 +0100


On Wed, May 26, 2004 at 03:59:09AM +0100, Olly Betts wrote:

> It's been pointed out to me that the PHP bindings are wrapped with any
> C++ namespaces removed.  Particularly bad is Xapian::Auto::open() which
> just becomes open() in PHP.

Yes, this isn't pleasant :-(
 
> Apparently PHP4 doesn't have any formal namespace-like feature, but we
> can simply prefix all Xapian symbols with "xapian_".  I'm told that's
> a common convention.

That seems reasonable, yes.
 
> There's also no PHP specific documentation or examples.  In general
> the C++ API documentation is a useful reference, but a document noting
> how names, types, etc are mapped, and any differences would be useful -
> like this one for the python bindings:
> 
> http://cvs.xapian.org/*checkout*/xapian/xapian-bindings/python/docs/bindings.html

It wouldn't take long for someone to rehash this for PHP. Most of the
comments will be the same; the main difference is that the Python
bindings support iterators that behave like Python iterators.
 
> Also a few small examples would be useful to get people started (again
> like the python bindings have).
> 
> Does anyone have anything akin to simpleindex.cc and simplesearch.cc,
> but in PHP?  That would at least get people started.

I'm good with PHP4, but I haven't yet managed to get the bindings to
build. If someone wants to send me a .so of the Xapian PHP4 bindings
either for 32bit i386-linux or for 32bit sparc-solaris, I'll have a
look at doing that (based on the Python ones).

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james@tartarus.org                               uncertaintydivision.org