Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#488 closed defect (fixed)

Enable directors for PHP

Reported by: Olly Betts Owned by: Olly Betts
Priority: normal Milestone: 1.2.6
Component: Xapian-bindings (PHP) Version: SVN trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description

SWIG now supports directors for PHP, but they have a bug which prevents use with Xapian. Here is the patch of the work so far - once the SWIG bug is fixed, this provides most of what is needed on the Xapian side.

Marking for 1.2.x as this doesn't make incompatible changes, just enables features which aren't currently supported for PHP.

Attachments (2)

xapian-php-matchdecider.patch (1.7 KB ) - added by Olly Betts 14 years ago.
patch which enables directors and adds a feature test
php-generated-code-director-fix.patch (899 bytes ) - added by Olly Betts 13 years ago.
Example of the changes we want to make to the generated code

Download all attachments as: .zip

Change History (8)

by Olly Betts, 14 years ago

patch which enables directors and adds a feature test

comment:1 by Olly Betts, 14 years ago

comment:2 by Olly Betts, 14 years ago

Component: Xapian-bindingsXapian-bindings (PHP)

comment:3 by Olly Betts, 13 years ago

Milestone: 1.2.x1.2.6
Status: newassigned

PHP directors now pretty much work, so I've applied the patch above and committed it in r15487.

There's still one wrinkle - objects passed to director methods called from C++ don't currently get a PHP class wrapper (just the raw resource is passed), so you have to wrap them yourself right now. So I'm leaving this ticket open for this remaining problem.

by Olly Betts, 13 years ago

Example of the changes we want to make to the generated code

comment:4 by Olly Betts, 13 years ago

Resolution: fixed
Status: assignedclosed

Fixed in SWIG. Special handling removed from smoketest.php and simplematchdecider.php5 in r15518.

comment:5 by Daniel Ménard, 13 years ago

Really happy to see this happening!

Juste a detail : I noticed that simplematchdecider.php5 is using php short tags (<? instead of <?php) which is not good practice and prevents trac hightlighting.

comment:6 by Olly Betts, 13 years ago

OK, I fixed the short tag in r15547 - thanks for pointing that out.

I think I must have managed to delete the "php" there by accident somehow, as I based the example on one of the existing PHP examples, which all have non-short tags at the start.

Note: See TracTickets for help on using tickets.