Re: Embedding PHP, few additional questions.
| From: | Ingwie Phoenix | Date: | Thu, 26 Jun 2014 10:22:20 +0000 |
| Subject: | Re: Embedding PHP, few additional questions. | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-75087@lists.php.net to get a copy of this message | ||
Am 26.06.2014 um 12:14 schrieb Johannes Schlüter <johannes@schlueters.de>:
> Hi,
>
>
> On Thu, 2014-06-26 at 11:50 +0200, Ingwie Phoenix wrote:
>> I am working on a nodejs module that allows to embed PHP (to use it
>> within HTTP servers, for example). I wish to extend with a small
>> thing. Instead of starting, running and shutting down the engine, I
>> would like to keep it running, and just reset its state. Why? I
>> *think* that this would keep my OPCache. Sadly, I did not find any
>> documentation on how OPCache saved its…cache. Its just ment as a
>> matter of speed improvement.
>>
>> How can I just reset the engine, without shutting it down?
>
> I don't now what you mean by "reset" PHP is meant to serve requests, one
> after another, where each request has its own context. Probably youwant
> to run request cycles?
>
>> The embedding instructions that I will use are here:
>> http://phi.lv/?p=376
>
> This sees to use the high level embed APIs. Use
> php_request_startup(TSRMLS_C); ... php_request_shutdown((void *) 0);
> style loops. See embed API implementation, and a simple SAPI like
>
> https://github.com/johannes/pconn-sapi/blob/master/pconnect-sapi.c#L180
>
> johannes
Hey Johannes.
With „reset“ I was meaning to reset the interpreter and internal VM - so that my OPCache would
be preserved, but the used variables and such are unset, so the script can run again - but off the
cached OP codes, instead of the script. Is that possible? And thanks, i will look into that link!
Kind regards, Ingwie.