Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108437 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 38312 invoked from network); 10 Feb 2020 18:33:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Feb 2020 18:33:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 49B19180211 for ; Mon, 10 Feb 2020 08:47:00 -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.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-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (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 ; Mon, 10 Feb 2020 08:46:56 -0800 (PST) Received: by mail-oi1-f171.google.com with SMTP id v19so9781281oic.12 for ; Mon, 10 Feb 2020 08:46:56 -0800 (PST) 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=wAM+n9d7bfgLD96NY9rIXmaSGewvQqBiH3/U6Dw3Kic=; b=Qv9qo/LxbUttlwqnmYW4o2EwQ6swquUifxYBMTxxcd9q9ZnwEx5Cb7mOnj1weW+BuL jP9X6wYPKHnCtG7DFLih1m+gAHA5eaTq05bmPHQyHZWIxzGvdCa6LgHcb58CCDSugiPX MZYC8y+U4HtWPyfJLRXuBk9i4JMY917VMBmVykeVVXttCRGbzoVbxZkzgGzuGC8Atdxy jGbJJ9iiwL7MrrVzOBuX8mDieT2Hj9AvTYzjxZXfFWLPi6Szf4UDTwGdLujmDuxA0iCm FgLbSajLx0UeVrvsYl35FtNLphF9OSbIvr0eNMu/K0OBN4NvrlYwAb0Z7DadJyqG2nnn GaJA== 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=wAM+n9d7bfgLD96NY9rIXmaSGewvQqBiH3/U6Dw3Kic=; b=CNmiE15dGPDIwgVAsRAH19RMk6Ioaer7kX36rgeviQ3197gDDFyYQs/L8/tVygZlnu JUN1SlmlbAYiONPdAF24qcHz7Cbtot8ZeyZ3E5rZpLVWW4yujdZ1IW45pmGRqD8lrH4O ieoCht8si3TcpP0Vt7OSqB+SvKgupT7vGnuqi/VZTIA3E1d5Es8qaAe2/V/flFS+cWlP uiZOBi/xt0vXpugekXW1IJmvog615Uk0mesx/ZgncLmfNkV6xA8gnQETwx3CwpSFh3a4 Lqezh4Dde9qwJcPmqIl3H19+b/8zCWmHzPK34tNYMn5D/W/bPy+rJesFMLY0ZZNTS+UB ShLQ== X-Gm-Message-State: APjAAAVqSiUzHbPiECBbUHODFR7ZQf5HL+fqX7FcWfPActEpMTa0mOUN S3QrgeV8XbduPDMlOeps+iPJ+kx2V1gMwLjuuziRCjhZiEx1UQ== X-Google-Smtp-Source: APXvYqxr11zvDo6WnkAL/vdM4UAoEWQfA5RGQmK4eysg846iIhfDMhArvjARjj1j1WprMWrUilAju6TzYoIfC6/U8zo= X-Received: by 2002:aca:2112:: with SMTP id 18mr1303577oiz.155.1581353214422; Mon, 10 Feb 2020 08:46:54 -0800 (PST) MIME-Version: 1.0 References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> In-Reply-To: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> Date: Mon, 10 Feb 2020 17:46:43 +0100 Message-ID: To: "Paul M. Jones" Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000009c32f6059e3b7ca1" Subject: Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2) From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --0000000000009c32f6059e3b7ca1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Paul, thanks for bringing it back. Got some questions: 1. In your RFC $_ENV is bound to $request. Looking at HttpFoundation can see it's build from $_GET, $_POST, $_FILES, $_COOKIE, $_SESSION and then looking at PSR ServerSideRequest it's build from $_COOKIE, $_GET, $_POST, $_FILES, $_SERVER but none of them bounds $_ENV. Server environment variables basically don't change over time when server process runs. What is the specific use case that requires them to be coupled with $request instance? 2. In your RFC all headers are mapped to $request properties This behaviour is unclear and unusual to me, for eg. in summary can see that if server request has "Header-Name" it is found in $_SERVER["HTTP_HEADER_NAME"] and that one is bound to $request->headers["header-name"], ok but the next line with example for "Content-Type" shows that it's bound to $request->contentType - which means probably that it can be accessed in $request->headers["content-type"] as well, right? seems logic. Going further, for eg. $_SERVER["PHP_AUTH_PW"] is bound to $request->authPw and then what will happen if the request will receive "Auth-Pw" header? a) It'll be bound to $request->headers["auth-pw"] ? b) It'll be bound to $request->authPw ? c) None of above. With those above I would see a set of getters like getContentType() or getAuthPassword() etc. instead of ServerRequest instance properties and a single point to retrieve header values just like well known ParameterBag's from HttpFoundation to operate on get, post, headers etc. BR, -- Micha=C5=82 Brzuchalski --0000000000009c32f6059e3b7ca1--