Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75086 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53212 invoked from network); 26 Jun 2014 10:15:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2014 10:15:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:54288] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/31-39155-5B2FBA35 for ; Thu, 26 Jun 2014 06:15:18 -0400 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 74F154132D; Thu, 26 Jun 2014 12:15:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=ALL_TRUSTED autolearn=ham version=3.3.2 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.31] (ppp-93-104-10-103.dynamic.mnet-online.de [93.104.10.103]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id 6003D41328; Thu, 26 Jun 2014 12:15:17 +0200 (CEST) To: Ingwie Phoenix Cc: internals@lists.php.net In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Thu, 26 Jun 2014 12:14:39 +0200 Message-ID: <1403777679.12695.14.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Embedding PHP, few additional questions. From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) 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