Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109061 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 57938 invoked from network); 16 Mar 2020 16:38:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Mar 2020 16:38:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4F23A1804F6 for ; Mon, 16 Mar 2020 08:01:11 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, 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 relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) (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 ; Mon, 16 Mar 2020 08:01:10 -0700 (PDT) Received: from samurai.attlocal.net (107-223-28-39.lightspeed.nsvltn.sbcglobal.net [107.223.28.39]) (Authenticated sender: pmjones@pmjones.io) by relay10.mail.gandi.net (Postfix) with ESMTPSA id A9AA824000C; Mon, 16 Mar 2020 15:00:38 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) In-Reply-To: <8A04B273-B298-4A2F-B0A5-8DF1F1D129A9@newclarity.net> Date: Mon, 16 Mar 2020 10:00:32 -0500 Cc: Stephen Reay , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <6529D99D-1ACF-4072-BA63-9B9EDB3C81AE@pmjones.io> References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> <0B40E6E5-342F-4D81-9CAA-A0C0739A7718@pmjones.io> <102D234E-BC5D-42B2-ABC4-93980C1F76A4@pmjones.io> <71A325BA-3F53-4C9D-BE6A-D9A068A42AEA@koalephant.com> <8A04B273-B298-4A2F-B0A5-8DF1F1D129A9@newclarity.net> To: Mike Schinkel 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 all, That escalated quickly. :-) I'm going to reply to the only request for = clarification I could identify in this exchange -- if I missed others, = please let me know. >> Is the proposal really suggesting that a developer would still need = to do `if(!empty($request->server[=E2=80=98HTTPS=E2=80=99]) && = $request->server[=E2=80=98HTTPS=E2=80=99] !=3D=3D =E2=80=98off=E2=80=99) = {=E2=80=A6}` rather than just providing a `secureTransport` property (or = `https` if you prefer)?=20 >=20 > Not sure. Paul needs to answer that. This is another one of those places where several of the individual = projects have something similar, but not close-enough to each other to = represent it in the ServerRequest object. Some honor '1' as 'on', some = do not, etc. So, yes, I'm saying that existing code using $_SERVER could use this as = a replacement: $secure =3D ($request->server['HTTPS'] ?? null) =3D=3D=3D 'on'; I'm open to discussion about additions to the object for this or other = purposes, though, if we can decide on "the right way" to calculate new = proposed values. --=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