Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49764 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79803 invoked from network); 18 Sep 2010 10:52:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2010 10:52:43 -0000 Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:54327] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/31-07299-9F9949C4 for ; Sat, 18 Sep 2010 06:52:42 -0400 Received: by vws18 with SMTP id 18so2264384vws.29 for ; Sat, 18 Sep 2010 03:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=o4TsmtQcyYt1XZ2w5zYsquS304NiuuGqksFo6JE8pic=; b=FabUhxBzqI9AImcpRsbjwX2ZSfYs0gHBKF4XIP/yU4ffNmzQSips0nLhkWAOSj+ZI1 rg09lrlRl1w5VFgSfOGr5ZKfrvpKljb09QWhXX7iHI+KAB3SQavrKy6Rrz6xtVF2bY8w AWhHXwCpTed2uBw8ydv/5WsKE8elrMca0jnHU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=MHP3AJuPuaTpLud++n3Cqx6AsoZt4jsszs9U8iHU7DADEFf9V+6OEaIug3YSd7Y/OK FKgKFYlplwCADyKZlc7BE2rbNULj1dsSeey8bazB31TE0xMw0st23zJ4hTr9UUc9wZh7 kuI/Img1p4rGcJLPZG6Ndu2eei/RXnJtjG4YI= MIME-Version: 1.0 Received: by 10.220.71.136 with SMTP id h8mr3716583vcj.275.1284807158705; Sat, 18 Sep 2010 03:52:38 -0700 (PDT) Received: by 10.220.49.98 with HTTP; Sat, 18 Sep 2010 03:52:38 -0700 (PDT) In-Reply-To: <75.C6.30333.B7FD39C4@pb1.pair.com> References: <75.C6.30333.B7FD39C4@pb1.pair.com> Date: Sat, 18 Sep 2010 14:52:38 +0400 Message-ID: To: "Matthew C. Rice" Cc: internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Earliest zend_eval_string can be called? From: indeyets@gmail.com (Alexey Zakhlestin) On Sat, Sep 18, 2010 at 1:37 AM, Matthew C. Rice wrote: > Hello, > > =C2=A0 I was wondering how early a zend_eval_string call can be made. Cur= rently > it works fine in a PHP_FUNCTION(), but was hoping to put it in a PHP_MINI= T() > in hopes of it just executing once. > > =C2=A0 It seems PHP_MINIT() is too early, and is causing failures. I came= across > PHP_GINIT_FUNCTION(), but can't seem to find when its called exactly, but > the same situation as PHP_MINIT() seems to be the case, where its too ear= ly. > > =C2=A0 In short, I am wondering if there is any place I can put the > zend_eval_string() call in hopes of it running just once, so its result > could be retained throughout the module execution. definitely, not earlier than PHP_RINIT(), which doesn't help you. all php's "userland" code is executed in the sandbox and sandbox exists between PHP_RINIT and PHP_RSHUTDOWN the only way to execute userland code before serving requests is to use long running process, which serves requests from userland. That's what I do in http://github.com/indeyets/appserver-in-php --=20 Alexey Zakhlestin http://www.milkfarmsoft.com/