[Xapian-discuss] PHP Bindings

James Aylett james-xapian at tartarus.org
Wed Sep 8 14:14:46 BST 2004


On Wed, Sep 08, 2004 at 02:00:36PM +0100, Olly Betts wrote:

> > I think the examples should assume the invocation will load the .so,
> > personally.
> 
> OK, but we should document how to make sure it's loaded then, otherwise
> users face a potential frustration trying to get even the examples to
> run.
> 
> Alternatively, we could try to load the extension if it's not already
> loaded.

Yes, but that means you have this code at the top of the examples which
is confusing :-(

Documenting it would be fine, I think. Anyone else?

> I'm planning to add an automated "smoke test" to each bindings too, so
> "make check" will run a simple script for each which at least ensures
> that the extension can be loaded and (say) stemming a word works.

Could we have a slightly bigger one that tests the core Xapian
functionality through InMemory?

> I think we also want two modes of installation - currently we carefully
> try to detect the standard directories to install stuff into for each
> language.  However if you're not root, this means you need to install
> your own copy of the interpreter, mess with libtool's abstraction and
> poke around in .libs, or mess with DESTDIR when installing.  If you
> could force everything to be installed under --prefix, then most
> languages allow you to load extensions from non-standard locations,
> and ideally we want to document the required runes ("make check" will
> need to use them too).

We discussed a while ago having something like --python-lib-dir or
something, to override Python's built-in system path (and other
languages similarly).

Python you set PYTHONPATH.
PHP you need to do one of two things (first will be best for make
check):

 * php -d extension=/full/path/to/xapian.so (or in php.ini)
 * php.ini contains extension_dir appropriately; php -d
 extension=xapian.so (or in php.ini)

[is_empty() vs empty() in bindings]

I vote for changing them all to empty() /
XapianWhatever_empty(). (It's possible that plain empty() in PHP could
have caused problems sometimes? Doesn't matter with prefixing.)

> In C++ at least, empty() will definitely read as a test not an action
> because STL containers use it (which is why MSet does).  Query isn't an
> STL compatible container, but it does hold things and could become a
> container one day perhaps.

I haven't programmed C++ seriously in so long ... provided we're
consistent, that's the main thing.

J

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



More information about the Xapian-discuss mailing list