Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126447 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 65A171A00BC for ; Tue, 18 Feb 2025 13:02:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1739883563; bh=B2K+s4ur9BRuUEujVbwwZt79G7FbixcA+9sNdSeWFHs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MMws+SmCDqgKkfuMYvNFjK/Dd04KBakOJfsC15rj37L3fiVH7g6wztVoXYmBY8sX3 GjBilnww2bG3sMRDKhOf5eBrMWVsuB6DlnVHeaLHYbpQeBClXlbUffKAhY8K3IOGuR dZTy4JF9UZ/JnQMBmRJ4kvpL4nJxBJLcMvC3PH4DDOEuKUKzu78weB+Qp7TaEL76yf kUQWpkKkfIGTI2sGeFP/W05b4ucVfQQA4ScxH3+e0rMWMMXuOIpHWHjBgKH3VFGLZq peL5A8LZfvQhxX8Z/eVJuQAVe+Y93xzbN3WY9JA/zph+pNkpfl+dpeZ/oUK7Hy65Qq ZoELjncb82LnQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E76CE180667 for ; Tue, 18 Feb 2025 12:59:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 18 Feb 2025 12:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1739883721; bh=0y78yHtIy3iGp4Kb75ivhozuNPf98d5EXeQREXAerM4=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=NviBJ28MS+w1nTy0aeODoSN9JMrga4DX1M9HBld6Awn80A/tzwoLXXXxghD1BD5+/ szRivzLpNQgUSP5e7VuX4xN4nW2+P3AtOhhd5uHBICq47gdbHxheS11ym1+Om3f3qK /6f4CrERv1a+xqQUkXd/DV54qYA1RAz0nsf1KfsJl71K5PAY41KK3vebRXD5zUiLnZ xoC/cqQwmvA9zb3q8hcqxRsn3UrKfP/qeQfhts6aPjo/h9nKzCyEQ5UuqfUbxWP3ZZ 7tui6Ongrk4LXxltoHetK6y66CpsAJHZX9a5KkMjlRwNVCxU8NOwlI+3CkEySKYfeT NjnX2rOxXgy8g== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Tue, 18 Feb 2025 14:02:00 +0100 To: Jordi Boggiano Cc: Internals Subject: Re: [PHP-DEV] [RFC] Modern Compression (zstd, brotli) In-Reply-To: <5fa7423e-d723-451e-a73d-a98512a6ca96@seld.be> References: <528e16e1-1fb3-448a-b187-7cc84e1bcc4a@seld.be> <5fa7423e-d723-451e-a73d-a98512a6ca96@seld.be> Message-ID: <8256945f09944cb16db34fd8139da63e@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2025-02-18 13:46, schrieb Jordi Boggiano: >> My question is: Why? Please also have a look at: >> https://github.com/php/policies/blob/main/coding-standards-and-naming.rst#namespaces. >> Instead of creating a top-level namespace for both Brotli and Zstd it >> would probably make sense to create a new “Compression” extension that >> could also include a new and improved gzip (and bz2) API as a >> follow-up. The new ext/random could probably serve as an API example. >> > The main reason why is that we were mostly trying to keep this simple, > so the RFC is simply what is currently in the extensions. But I fully > agree with you, this doesn't look like the cleanest API, and it might > be a good opportunity to clean things up. I assumed as much, but indeed a “blessed” implementation in core should be held to a higher standard and ideally make use of the latest and greatest language features to create an API that is a joy to use. As an example, the Brotli compression mode should likely be namespace Compression\Brotli; enum Mode { case Generic; case Text; case Font; } or something like that. > I guess we'll go back to the drawing board and try to come up with an > API proposal that fits in better. I would also suggest critically questioning whether all the features provided by the existing extensions are necessary. As an example, I'm not sure if the implicit output compression INI settings are actually necessary nowadays. The common webservers / FastCGI gateways will perform dynamic compression of FastCGI responses by default, making the implementation redundant and possibly requiring the user to configure compression in two places. And modern frameworks likely want to have strict control about the exact output as well. Best regards Tim Düsterhus