Simon Laws wrote:
Earlier I created a patch for a first pass at a PHP extension for C++ SCA (
http://issues.apache.org/jira/browse/TUSCANY-698)

This follows the pattern layed down by Andy with the Python extension and
has many limitations::

  Services only. No references.
  Basic input types only. No arrays or SDOs
  Single valued return values only. No arrays or SDOs
  C++ .h interface
  Error handling is not properly tied into SCA

I used this as an exercise to understand what Pete/Andy had done. As such I have taken the most basic approach to integrating with PHP possible. This is
not the way I recommend doing it in the long term. In the future I would
want to change at least the following.

 The embed API needs to be replaced with the PHP SAPI
 References should be supported using annotations and injection
 SDO should be supported as a databinding
 I would prefer to go to using WSDL interface descriptions

I have currently followed the pattern and gone with the following
implementation descriptions:

 When the script just has functions
<implementation.phpmodule="DivideServiceImpl"/>

 When the script has classes and functions
<implementation.phpmodule="DivideServiceImpl" class="DivideClass"/>

I wanted to go with module="DivideServiceImpl" but the code at present adds
.componentType to the end of the module name to get the component type
information. I didn;t feel that DivideServiceImpl.php.componentType was
right but I'm prepared to be convinced.

In the longer term I think it may be sensible to ditch the function only
approach as it makes the reference handling less obvious.

I haven't included the build file at present because we need to sort out the
windows build system and me adding yet another flavour of dev studio will
not help. I have though included Calculator sample files that use the
extension as per Andy's sample so you can look even if you can't run.

Lots more work to do but it's a start.

Simon


Simon,

I adjusted our Linux build to integrate your PHP extension, it builds OK for me on Linux using a php-devel-5.0.4-10.5.rpm after a few changes to Makefile.am (I also made a minor change to remove the dependency on CPPInterface like we did in the other extensions).

The build requires the following environment variables:
PHP_INCLUDE=/usr/include/php
PHP_LIB=/usr/lib/httpd/modules

Which version of PHP did you use on Windows? I tried PHP 5.1.6-2 first but I'm guessing that you used an older PHP level on Windows since your code uses php_embed.h, which does not seem to exist anymore on 5.1.6.2.

I'm OK to stay on that older level if it's simpler for you on Windows for now, or help build and test on a newer level. Let me know... Thanks.

--
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to