Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108778 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 73975 invoked from network); 26 Feb 2020 23:28:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Feb 2020 23:28:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BCF461804F2 for ; Wed, 26 Feb 2020 13:46:22 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE 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-yw1-f44.google.com (mail-yw1-f44.google.com [209.85.161.44]) (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, 26 Feb 2020 13:46:22 -0800 (PST) Received: by mail-yw1-f44.google.com with SMTP id n127so964901ywd.9 for ; Wed, 26 Feb 2020 13:46:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ty6j41gEq4HSetBsMBErUG4yIHxZvACXJN5VsCG/CGs=; b=DC1/WI7E1lJtPprs63abp1S/I/bxDfJTNf7yglH73ozFqfhz1tpMiHotq7yfLQbhTo hGQ5bddD5d9G40IZKQFXHqqZ15zXjC5/6F2dA0cKQ3qk/tuh+9MOno+SZ9ikt6NiCAs2 SfyLDrkzkT8IscOsRlfIJCMA598GC6FSrck1DqAyo47oR6hsBN7j0IpglW2ZDT0ki7k4 R9NjM4Ju7fyfiKL4gkfYeAftbQ+5aHIB6yKIpZZ97JeUYcXK/2HEOUf/rb4B/lHBpRa6 NRuYetpXQaSFMWGbztvCEKXZzqpv160+RdoB0wWcjOqN8yi8Rdv3TA/qkbX5ta+pbccn 0IaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ty6j41gEq4HSetBsMBErUG4yIHxZvACXJN5VsCG/CGs=; b=MN12AB8RLtQr/Ipi/yPPT1hCCMVYOYjBIjig/reGxInXCSHZi7FVQ9adM714f2fOoZ xl+J2UDy/4U+gCvEszdRG1EAMrbQdY85WlOBXWZRi3Gg46kucvDb0+vYVgS7EkP+EDAp /dfDU/6XDpWjFshlOApAoNBL6bJNcMVHWyy0VCjOxG0wmOWpSqg6UwiYGmuzZvQNSI1E 1NRHU/cnNJ8+lopBu6j33lni9dvIhhFUug0IMcOpjNfBmw6KMAqSq7gTI/JV+6O+XLIt 10NwaqDoqGsjf0eRV88RVjFkPyrX2C5Yh7EYm1srQgrTnWSVudNVgSF0a+K4LnPCccr3 TRKQ== X-Gm-Message-State: APjAAAU0jO6fE/TvsFIw4/FY5/CEdLai+4lj1+JD9JBf2ed1g7sLI/jP a9Bsk7GXQOw0XJvIRezfMr+wBQ== X-Google-Smtp-Source: APXvYqyb2k7XBVMCaCILR+T85wYwOvE6/JsfPoqNQM5EIKQZcMJu8ONYVPyvzWRMhAIwfcTrX4fcKQ== X-Received: by 2002:a81:9e02:: with SMTP id m2mr1170484ywj.99.1582753580139; Wed, 26 Feb 2020 13:46:20 -0800 (PST) Received: from ?IPv6:2601:c0:c680:5cc0:e883:9c:df56:1645? ([2601:c0:c680:5cc0:e883:9c:df56:1645]) by smtp.gmail.com with ESMTPSA id i17sm1575896ywg.66.2020.02.26.13.46.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Feb 2020 13:46:18 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: Date: Wed, 26 Feb 2020 16:46:18 -0500 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: <04754166-7BB1-41B9-BE9A-72DC6D0FE25B@newclarity.net> References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> <5904137.fSVIMsojiJ@mcmic-probook> <3DDBFBA4-8D3A-46C5-9A10-B093A5E2386B@pmjones.io> <54493258-B52E-442A-A11D-82E1D4C7DE5E@gmail.com> <8264F6CF-AD55-41E2-9F5A-DAE8942E2B79@pmjones.io> <1BF3D29A-04C6-4A82-9216-EAE991A38916@pmjones.io> <10388b3a-3402-a6dc-3837-b03d735edf46@gmail.com> <5ec7b4a7-508b-270b-916f-0504a116196c@gmail.com> <30112AFF-38F9-44D4-9D2F-03A32019764F@pmjones.io> To: Rowan Tommins X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2) From: mike@newclarity.net (Mike Schinkel) > On Feb 26, 2020, at 1:55 PM, Rowan Tommins = wrote: >=20 > On Wed, 26 Feb 2020 at 16:42, Paul M. Jones = wrote: >=20 >> Your presumption is correct! And your point on trying for better = names is >> well-taken -- though I think these are "expected" names, based on my >> research into existing implementations. The most-common names are ... >>=20 >> - the word "files" for unparsed or unmodified $_FILES values, leading = me >> to think $files is well-understood >>=20 >> - the words "upload(s)", "fileUpload(s)", or "uploadedFile(s)" for = parsed, >> transformed, or restructured $_FILES values, leading me to think = $uploads >> is well-understood >>=20 >=20 >=20 > That's a reasonable justification. Just to check, are there other > implementations that have both of these names side by side, or do most > implementations have one or the other, but using this naming? >=20 > The main confusion I can see is having to remember which two of these = is an > error without having to read the docs each time: >=20 > isset( $request->files['attachment']['name'][0] ); > isset( $request->files['attachment'][0]['name'] ); > isset( $request->uploads['attachment']['name'][0] ); > isset( $request->uploads['attachment'][0]['name'] ); Here is an easy way to remember: $request->files is exactly like $_FILES (and if you can't remember that, = blame PHP, not the RFC) $request->uploads is therefore new, and since it is new it follows a = reasonable collection-list-item structure (as opposed to an unreasonable = collection-item-list structure that PHP implemented in $_FILES.) So from those rules: // Don't use, it's the old way of doing things, unless you are just = replacing a reference to $_FILES then then it's a non-issue. isset( $request->files['attachment']['name'][0] ); =09 // Don't use, it's the old way of doing things, unless you are just = replacing a reference to $_FILES then then it's a non-issue. isset( $request->files['attachment'][0]['name'] ); //Don't use. Not a reasonable collection-list-item structure. Why would = "they" create a new API with a parallel array structure?!? isset( $request->uploads['attachment']['name'][0] ); // This one is golden! It's clearly new because of now $_UPLOADS = existing, and it follows a reasonable collection-list-item structure isset( $request->uploads['attachment'][0]['name'] ); #jmtcw -Mike=