PHP bindings: xapian.php missing

Olly Betts olly at survex.com
Wed Feb 19 03:37:23 GMT 2025


[Replying to a message that was held for moderator approval due to
an attached screenshot.  I tried to approve it in the admin interface
but it hasn't appeared on the list so I guess I pressed the wrong
key.  Luckily the moderation notification quotes the message (but
not the attachment).]

Wilbert van Bakel <wilbert.vanbakel at gmail.com> wrote:
> I followed the instructions from this page:
> https://trac.xapian.org/wiki/FAQ/PHP%20Bindings%20Package.
> It's confusing that I see PHP7 while I need PHP8, but it appears to work.

The packaging (and those instructions) haven't been updated for PHP8
yet.  I'll try to get around to doing that.

> - Creating a deb package for local installations fails because there is a
> reference to a file that is now missing.

SWIG no longer generates a .php wrapper file for PHP8 - the bindings
are now done entirely in C/C++ using PHP's C extension API.  This
is faster and less buggy than how it used to work.

> - Any language server complains about classes that are not found. See
> screen capture.

The classes are defined in xapian.so now, and are visible via PHP's
reflection API so I'd expect a language server should be able to see
them too:

    $e = new ReflectionExtension('xapian');
    foreach ($e->getClassNames() as $c) { print("$c\n"); }

outputs:

Xapian
XapianPositionIterator
XapianPostingIterator
XapianTermIterator
XapianValueIterator
XapianDocument
XapianRegistry
XapianQuery

and so on.

Cheers,
    Olly



More information about the Xapian-discuss mailing list