Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108986 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 38776 invoked from network); 11 Mar 2020 23:01:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Mar 2020 23:01:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3C55A1804D8 for ; Wed, 11 Mar 2020 14:23:03 -0700 (PDT) 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 11 Mar 2020 14:23:02 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id 6so4608872wre.4 for ; Wed, 11 Mar 2020 14:23:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3DogSQZ4ZRTaBPYZftADZcRZj2yF+klxbGOyaBOJ/uA=; b=mn6U+DYi93E2Ehozdc5iXRrjq/MoTygYEnDCMlH8KyddtcPl9BFmZaeaTNvS+hP4KI eQrzqK2KrVoNWUZaVRSMzhtfR4IjsVx2ei9mop8x+Y5zfNs55y4ozrjWos0UJupSjkLc rA181S9nlPoHurPoZJELCdvIflCAsNwvU4vJm8atY5WepSjwwlyGoEFwWirXiLco97Yx YoY0P5cM8Dhd7/42NZhsXcPIdoIrEdncreyMD7oEK5EUK96YBl0XEpenqSsgXmP/TnO/ R6M5hXq8XgN0KpRPsE2ambcti3yjxIbsmvY5AtH+4/L5mHMplUqojd/uFDROUfWm8NDt n3gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3DogSQZ4ZRTaBPYZftADZcRZj2yF+klxbGOyaBOJ/uA=; b=cbgpVl5KrJpxpYwGsXt6WXFuPFNhtWygRUWwtr/peHmPkKotH7LAYZ2asct+cJL+fd igzUwhRxfq4Ai5LPYlsxVfB/XGM7jiO22IDPNRW62K1kYLI9oEcA5qPTbsaFrgqCtfYo fdyYzy4rx5Z5RQcLgM+wg1UeT1iJx25gKqC7PTTTogpJNOx6zdKIEpJAgirjHyqD985S HWgJ/mQyYRk+P2jXuJsb1m7cutLxJm0DMh5TEC3SLw+//Ax/9M0uyB4TK4d0wdP6lMbQ ETt9180obfmB7y7eYy3+EPRzZo1Y1UWXQTxWvb2CERhnxIWEoM/QxKzqXi6vsl0R0tua 8svw== X-Gm-Message-State: ANhLgQ0Yh7rJTmLFL/9EuZbglAqW8UKd0Lh3fo6Lgq3BHSQLBS31DgC8 J/nWIXKcFYm8h+1OnJf9wy/+Ncyt50kRzkfXjLTT7n+b X-Google-Smtp-Source: ADFU+vt9DYIMASaWX+5oEhH5/1u5yQV+VdgsuCQazAuxF7EiwSW6kR/EOPuRKC6RLJqBvSNODsclDfsKm380nhbZuok= X-Received: by 2002:a5d:5512:: with SMTP id b18mr6282364wrv.215.1583961780482; Wed, 11 Mar 2020 14:23:00 -0700 (PDT) MIME-Version: 1.0 References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> <1657AB79-5CAF-4BCA-96B5-1343EC703CCD@pmjones.io> <38289BE3-41F1-4738-A3E0-0D9174A9F732@pmjones.io> In-Reply-To: <38289BE3-41F1-4738-A3E0-0D9174A9F732@pmjones.io> Date: Wed, 11 Mar 2020 22:22:32 +0100 Message-ID: To: "Paul M. Jones" Cc: php internals Content-Type: multipart/alternative; boundary="00000000000043754005a09ad7ab" Subject: Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2) From: arvids.godjuks@gmail.com (Arvids Godjuks) --00000000000043754005a09ad7ab Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 7 Mar 2020 at 23:50, Paul M. Jones wrote: > Hi Arvids, > > > On Mar 5, 2020, at 05:19, Arvids Godjuks > wrote: > > > > 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/a2872e13c3901401d5c2386a8ed62502db2= 3d5f2/src/ProcessSlave.php#L463 > > > > 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 li= ke > > this? > > > > ... > > > > it seems that this RFC does not allow such usage at all and long-runnin= g > 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 th= e > 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 m= e. > I took a deeper look into the GitHub repo and it answered a few questions - RFC just didn't give any examples of usage/instantiation and how you can make a new object. I was thinking it was a read-only global type object that lives and dies with the start and end of the request. > > > -- > 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 > > > > --=20 Arv=C4=ABds Godjuks +371 26 851 664 arvids.godjuks@gmail.com Skype: psihius Telegram: @psihius https://t.me/psihius --00000000000043754005a09ad7ab--