Johannes Schlueter wrote:
Hi Mark,
On Tuesday 14 March 2006 20:48, Marco wrote:
Is there a way from within the embedded system to destroy all created
variables so that the environment is the same as when it was started or do
we need to shutdown the embedded engine and start it up again?
PHP was designed as an language running as an module inside an webserver to
run multiple, independent, request, one after each other. So PHP supports
reinitilizing the engine without restarting everything. Look around for
php_request_startup() and php_request_shutdown() and how they are used.
Also a problem they are coming up with occasionally is that the php engine
will crash when
php_embed_init(argc, argv PTSRMLS_CC);
is called, they havent found any reproducible steps yet. Could this be
caused by shutting down and starting up the emdedded engine from within the
same app? I have asked and the application isnt multi threaded.
Here one can't say much without any details (_relevant_ code and backtrace)
php_embed_* are afaik wrapping up the complete engine und request init and
shutdown. If you want to do multiple independent requests you should take an
a bit closer look on the SAPI layer to use the functions I mentioned above.
If you want an example of doing request startup/shutdown multithreaded
with the embed SAPI and are willing to wade through a bit of XS, you can
check out the PHP::Interpreter Perl module (on CPAN:
http://search.cpan.org/dist/PHP-Interpreter/). That links against the
embed SAPI but uses the native engine calls for handling request
mortality. You could also check out Sara's runkit in PECL, I think that
does similar stuff.
George
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php