On 9/8/06, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:

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]

Hi Sebastien

Thanks for doing the linux build and for fixing up the dependency on the C++
extension. I really need to make a README describing how to build it. The
detail is a little opaque as I haven't made a patch for the windows build
files yet. I'm having a little difficulty in getting the right version of
the Microsoft Developer Tools. Anyhow...

I'm using PHP5.1.4 on Windows but 5.1.6 should be OK. On windows you will
have to get the source to get the headers but php5embed.lib is provided.
Strange huh.

To run the calculator sample you need to do a couple of things
1/ make sure that the directory holding php5embed.lib is on the path, for
example, create a version of runclient.bat with
  ...
  set PHP_HOME= where ever PHP is installed
  set
PATH=%PHP_HOME%;%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\cpp\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH%
  Client.exe %*

2/ make sure that php.ini includes a reference to the directory which holds
the .php file you are going to run as a component, for example, my
php.iniis in the same directory as the
php.exe and at the end of the file I have

include_path=".;C:\simon\Projects\Eclipse3.2\cpp\sca\samples\Calculator\deploy\packages\CalculatorComposite"

you can use php -i to find where php is looking for you php.ini files. 4th
or 5th line down should tell you.

Apologies again for not yet providing a README that describes all this. I'll
get to it shortly. Let me know if this doesn't help.

Regards

Simon

Reply via email to