[Xapian-discuss] Another PHP 5 wrapper...

Sam Liddicott sam at liddicott.com
Tue Apr 18 20:34:51 BST 2006


Olly Betts wrote:
> On Tue, Apr 18, 2006 at 07:33:18PM +0200, Daniel M?nard wrote:
>   
>
>
>> Some additional remarks about the current wrapper :
>>
>> I think we should avoid, if we can, having global functions or constants 
>> in the generated wrapper (avoiding "global namespace pollution") :
>> - I am not sure that the "$XAPIAN_LOADED__" stuff at the top of the file 
>> is really necessary (php has function like include_once or 
>> require_once), but perhaps it is automatically generated by SWIG ?
>>     
>
> Yeah, SWIG always adds that.  But it can be changed if there's a better way.
> I think that dates back to Sam's spell as maintainer so he may be able to
> say if there's a good reason for doing it like that.
>
>   
Sure, there is include_once, but that doesn't mean the user uses it, no 
does it mean that the .so wasn't loaded some other way, perhaps in such 
cases where a user has a personal php xapian extension and then a 
systemwide one appears.

As best as I could work outm that was the best way to tell if the .so 
was loaded.
The next best way is 
function_exists("some_function_that_is_unlikely_to_change") but thats 
even less ideal.

Thanks to Olly for answering the hard questions and carrying on with 
swig, it surely seems as though eh does know what he is doing.

Sam



More information about the Xapian-discuss mailing list