[Xapian-discuss] PHP Fatal error while indexing Wikipedia

Olly Betts olly at survex.com
Thu Jan 3 02:06:42 GMT 2008

On Thu, Jan 03, 2008 at 01:39:42AM +0000, Robert Young wrote:
> I won't be any help with SWIG I'm afraid but something else which I've
> done a couple for this evening is wrapping the Xapian style iterators
> up in PHP-SPL iterators so that they can be used in foreach loops,
Great, that's something on my wishlist.

> also the ArrayAccess and Countable interfaces could be implemented for
> quite a few as well. If I understand correctly the xapian.php file is
> completely generated, but it might be nice to provide an extra file of
> helpers. I'd be more than happy to put some bits together if you think
> it would be usefull.

You're correct that "xapian.php" is generated, but it's easy to insert
hand-written code into it (such code should go in php4/util.i):


Once I've got a working example of what this should look like for a sample
class, I may actually be able to get SWIG to generate the code
automatically (or with a %feature hint) which would reduce the effort
required to wrap new classes, and also benefits other SWIG users (this
is exactly how the PHP5 class wrappers were implemented).  But that's a
longer term thing.  Hand-coded helpers are fine for the time being.

Once you've got a working patch, please open a wishlist bug and attach
it to make sure it doesn't get lost.  Ideally we need some feature
tests adding to smoketest5.php to ensure it works correctly and to
prevent it accidentally getting broken by future changes.


More information about the Xapian-discuss mailing list