Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121261 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 2944 invoked from network); 7 Oct 2023 12:07:12 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Oct 2023 12:07:12 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BF50D1804B4 for ; Sat, 7 Oct 2023 05:07:10 -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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 7 Oct 2023 05:07:10 -0700 (PDT) Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-27761d85b31so2006537a91.3 for ; Sat, 07 Oct 2023 05:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696680429; x=1697285229; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=ELLuIbDbf1pu71Yaz71bDB3CBYEC6GynyclOvqDz16I=; b=E/KJl6cVaGYl9xzbBWVicrDvw0I7XNUyni8bFzR4tTkDaY2mt3Pnn2mSLR6ZH1UusG yzHmhFjoKWAC/O3rjIH6nF7rK0lmrq6rrcMlNUNWuNChz6n78eF6KSPpI9bgC/ry6//d vXbxiAKQl+IXX7jXqrv5KDSx2QRcbufKjlinGfBl+ujS1icCVZYVQjMQ32CqhT98Syjy Y2AxzQJ+25TCRRB4AcnM2Mfjvbwfp3pNHIzZ/jB3a2d+XFu84JPxpLpv8zbkMui8N9hB 07xgak3+q3IqC+C9GVtBd7x+q+LZn8OXChQsZY1qxOuc68IZd/BZgZJfZh+ZWndxG+U1 f2YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696680429; x=1697285229; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ELLuIbDbf1pu71Yaz71bDB3CBYEC6GynyclOvqDz16I=; b=OOkEgH8W9M+nvOi24Ga7mtDDeq9Jvwi642Mjl7cAqx6e4oKcp9/KOiP1O32DHNnxGF vdSWMHVlwQyhmNbBYkafLzyAL37YfPaWlDk5TcV2UPi5lVOu6MNvRAURG1BeUpba4Zpt MbaRkRg6VX5bSYRp9GCuukuT4VcJvnnw031caQ7hO1grbqcL1wU1YBirGmkWMcNwL3dF /sCPh0C0JgUxLxhaoWlgGj9ILWEumRPbvlChVXQihBvL3jssIT4tdS6KcHjtdrGcirfr iGxWMHeHHodVeCN86x0btwK4RZ4SM1I+9StDYjOyhV4kqgci+4E7lp5C45PDUwm8DMqx tNPA== X-Gm-Message-State: AOJu0YwTQMwMB1/ibE7mj7VpEe0z9e5g3je8MX0m7V0k1dQxY/EW/NRg 1Li67Vno5aZgnEcCUEXiEZAKty8ne+6uwjwNLsDLx9RjeQdAxQ== X-Google-Smtp-Source: AGHT+IH2cgGNYtMBs3aNZqcQK05BZ27+q3ww6huRPkI9vZtP5GLhkr8NZpnrDDsL6cF4JfWlJm6mYY3IGMvF5qGTIDs= X-Received: by 2002:a17:90a:9d82:b0:269:621e:a673 with SMTP id k2-20020a17090a9d8200b00269621ea673mr9941339pjp.1.1696680428763; Sat, 07 Oct 2023 05:07:08 -0700 (PDT) MIME-Version: 1.0 References: <6fccfe47-21ac-fa5b-e52e-28064f26125b@bastelstu.be> In-Reply-To: <6fccfe47-21ac-fa5b-e52e-28064f26125b@bastelstu.be> Date: Sat, 7 Oct 2023 14:06:57 +0200 Message-ID: To: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC][Under discussion] RFC1867 for non-POST HTTP verbs From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Tim > On 10/6/23 15:44, Ilija Tovilo wrote: > > https://wiki.php.net/rfc/rfc1867-non-post > > > > Regarding the cleanup of the files, perhaps the files could be read into > a `php://temp` stream > (https://www.php.net/manual/en/wrappers.php.php#wrappers.php.memory)? > > While this would cause the function to be incompatible with $_FILES, I > think it would make for a much nicer API and it would also automatically > solve the cleanup problem. php://temp would solve auto-cleanup of files nicely. However, whether they are easier to work with will depend on what you're doing with the file. The most common action after a file uploads is arguably to move it to a permanent location using move_uploaded_file(). With a stream the obvious way to achieve the same is stream_copy_to_stream(). However, as the stream already has a file backing (if big enough, at least) this copy is unnecessary. Please correct me if there's something I have missed. I also would really like to avoid subtle differences between the automatically and manually invoked files. Given that the overwhelming majority will not use PHP with something like RoadRunner, I think it makes more sense to add the special casing (i.e. deleting the files manually) in the uncommon case, than for everybody else to adapt their code for the uncommon case. Ilija