Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73765 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65474 invoked from network); 22 Apr 2014 11:13:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Apr 2014 11:13:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.44 as permitted sender) X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 209.85.215.44 mail-la0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:36421] helo=mail-la0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 66/12-45364-CBE46535 for ; Tue, 22 Apr 2014 07:13:01 -0400 Received: by mail-la0-f44.google.com with SMTP id b8so589528lan.17 for ; Tue, 22 Apr 2014 04:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=eP3SHnSCSMC8SdDtZCQQRUvADJgBzMzEhOZoseQXjsg=; b=dfMi2i/D8Csqz9GVTU/2dPkzM4kyInx9gDSYCLsvzgWKGFjat2WFa7MBSLsa1awNfr 0PiWJZ5sh3dBZPG3yiAekAYJwYjUkXRTYwsUtMLJ+9Qwh9pF6Tk2kfdX4KsK6eLdWUM4 qmRvDiucZ2rU7fmNLfo/Mfzb1ANfWbvZ3/t76ldTG0FDKE3qXq3AahR67QcVCXeAOUv+ WwY7sdvRVUnjU0cFACPJKkp5LCSBjENMWaLzNYbCxQpiQe+xQV1yY+7DsIOE5MkfUYBz EtJzrjh/8i5FXkpvQC95etw8XlVhzl/HL6MW97C7nUlvyH+6eLTniCIX/WJAgEYrMaNq MgIg== X-Received: by 10.152.87.14 with SMTP id t14mr1417801laz.52.1398165177985; Tue, 22 Apr 2014 04:12:57 -0700 (PDT) Received: from [10.0.1.8] ([46.252.161.106]) by mx.google.com with ESMTPSA id cr6sm40501445lbb.19.2014.04.22.04.12.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 04:12:56 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_30434A5F-B7AE-44DA-B175-704E3B7BF1CC"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) In-Reply-To: Date: Tue, 22 Apr 2014 15:12:45 +0400 Cc: internals@lists.php.net Message-ID: References: To: Park Framework X-Mailer: Apple Mail (2.1874) Subject: Re: [PHP-DEV] [FPM] Reused PHP script as daemon process From: indeyets@gmail.com (Alexey Zakhlestin) --Apple-Mail=_30434A5F-B7AE-44DA-B175-704E3B7BF1CC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 22 Apr 2014, at 02:27, Park Framework = wrote: > Add, function fastcgi_handle_request(callable $name) for reused script = as > daemon process. >=20 > With each new request, all superglobals variables ($_GET, $POST, = $_COOKIE, > $_SERVER, ...) with new values from current =E2=80=8B=E2=80=8Brequest. Exposing FastCGI lib to userland is something we already were talking = about, but I don=E2=80=99t think your choice of API is good. Something like this would be much cleaner: $data =3D fastcgi_parse_request($input_stream_or_string); Then, you can call your handler manually, and: echo fastcgi_encode_response(200, ['hea' =3D> ['de', 'rs']], $body); lower-level functions could be useful too (for partial answers, etc.) --=20 Alexey Zakhlestin CTO at Grids.by/you https://github.com/indeyets PGP key: http://indeyets.ru/alexey.zakhlestin.pgp.asc --Apple-Mail=_30434A5F-B7AE-44DA-B175-704E3B7BF1CC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQEcBAEBCgAGBQJTVk62AAoJEMkJcRxZdR279ZwIAInyV7ZWw5TKp0uvihAP52c4 xTE5/q0PSITtySTR2j5pZFZSPVkkbsC6BijSFMb4byOVejk879nECa3Sjgjr1YF1 peRr0VuJEosgLZsiouw1/RXxWJfT62krdL42U2ePMOSAEHXLyJTzrs8HM2QGGNhl out+J8dY6NAkQ1C7hsDu9gHUo6lGxkUnc156dWDVHUO0u0V9nikep2qY0RUxZmAW QUvr31o1d9mH4H7yuHbu+wLMHTSSw0x5fxDYp5ML/XiHGQbYIITdnZ10DgztTqli 5m2m1HDJINvGlZJRZSVgVYzBOsFpFCffrduFE6wzkYbzJbbDadDtkZsUJGRtPes= =pUbi -----END PGP SIGNATURE----- --Apple-Mail=_30434A5F-B7AE-44DA-B175-704E3B7BF1CC--