Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108894 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48798 invoked from network); 8 Mar 2020 00:30:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Mar 2020 00:30:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3F9DC1804D3 for ; Sat, 7 Mar 2020 14:50:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29169 217.70.176.0/20 X-Spam-Virus: No X-Envelope-From: Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 7 Mar 2020 14:50:17 -0800 (PST) X-Originating-IP: 107.223.28.39 Received: from samurai.attlocal.net (107-223-28-39.lightspeed.nsvltn.sbcglobal.net [107.223.28.39]) (Authenticated sender: pmjones@pmjones.io) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 0DA67FF802; Sat, 7 Mar 2020 22:50:14 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) In-Reply-To: Date: Sat, 7 Mar 2020 16:50:12 -0600 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: <38289BE3-41F1-4738-A3E0-0D9174A9F732@pmjones.io> References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> <1657AB79-5CAF-4BCA-96B5-1343EC703CCD@pmjones.io> To: Arvids Godjuks X-Mailer: Apple Mail (2.3608.60.0.2.5) Subject: Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2) From: pmjones@pmjones.io ("Paul M. Jones") Hi Arvids, > On Mar 5, 2020, at 05:19, Arvids Godjuks = wrote: >=20 > one question I do have here is about how PHP-PM process manager will = be > able to interact with this layer? > Cause right now it does rewrite the $_SERVER variable for each = incoming > request for its child processes that handle the requests > = https://github.com/php-pm/php-pm/blob/a2872e13c3901401d5c2386a8ed62502db23= d5f2/src/ProcessSlave.php#L463 >=20 > It kind'a makes this not possible if there is no way to re-init the = object. > While read-only is, obviously, a good idea, there are some caveats = like > this that not only limit the possibilities but also what will the > ServerRequest object even look like when $_SERVER is being rewritten = like > this? >=20 > ... >=20 > it seems that this RFC does not allow such usage at all and = long-running processing has not been taken into account at all? I have never used PHP-PM, so I am talking outside my competence here. Even so, I see the ProcessSlave::prepareEnvironment() method rewrites = $_SERVER. Instead of re-initializing an existing object, would it be = sufficient to create a new ServerRequest object after that point, with = the newly-modified $GLOBALS values (in which $_SERVER is represented)? = You would then use that new instance in the new child process. Regarding a long-running process, I could see where the entry point = might create a new instance of ServerRequest as needed, using the = current $GLOBALS state, and pass that new instance into whatever handler = gets invoked. I am probably missing your point; if so, my apologies, and please guide = me. --=20 Paul M. Jones pmjones@pmjones.io http://paul-m-jones.com Modernizing Legacy Applications in PHP https://leanpub.com/mlaphp Solving the N+1 Problem in PHP https://leanpub.com/sn1php