We are developing a (Win32) C++ application which among other things is
able to generate some HTML pages and send them to an HTML client (in the
same app actually). Now for more flexibility we would like to filter the
generated pages through PHP. What should be the best/easiest way to
proceed? I would like to avoid any temporary files as much as possible.
1. Use _popen or CreateProcess to launch PHP-CGI.EXE, feed the input file
in stdin and capture stdout. I'm afraid this will create nasty black
windows on the screen.
2. Include <php.h> etc and call php_execute_scr ipt() et al directly (are
these documented somewhere?). Seems to be very file/stream-oriented, I
would like string-in, string-out instead.
3. Install php ActiveScript support and call it via COM interface. Seems
to be the cleanest approach, but how to do it in C++? Any examples?
4. ...?
Also, what possibilities are there to pass data to php? Again, I would
like to avoid temporary files. Possibly to inject variable/array creation
PHP code directly in the passed script text?
thanks in advance
Paavo
able to generate some HTML pages and send them to an HTML client (in the
same app actually). Now for more flexibility we would like to filter the
generated pages through PHP. What should be the best/easiest way to
proceed? I would like to avoid any temporary files as much as possible.
1. Use _popen or CreateProcess to launch PHP-CGI.EXE, feed the input file
in stdin and capture stdout. I'm afraid this will create nasty black
windows on the screen.
2. Include <php.h> etc and call php_execute_scr ipt() et al directly (are
these documented somewhere?). Seems to be very file/stream-oriented, I
would like string-in, string-out instead.
3. Install php ActiveScript support and call it via COM interface. Seems
to be the cleanest approach, but how to do it in C++? Any examples?
4. ...?
Also, what possibilities are there to pass data to php? Again, I would
like to avoid temporary files. Possibly to inject variable/array creation
PHP code directly in the passed script text?
thanks in advance
Paavo
Comment