Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126450 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 9A0771A00BC for ; Tue, 18 Feb 2025 14:41:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1739889522; bh=3WmjctCLzqQrUTMBjIHlgFYWyGLAfuOFIi48yv85kZw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IrIOz0bj38J5fE2qmZFs9OupSZOWOFUCBIFtJ79sr8OryaFETpPdiqlf/e6edky1i ZqCMF6pLNp8k7puQRzLZ1Dl4iMu1UnGlb58BbmqvX0zIFPiOoiZFq8tifPgPXSYq9y QYgR/Jn5bCkxiLaPaJamzOfQCLppE0LCvRSxtFwIYfHTvxsoMvXXCOijrpWZEJavhp MYLyJAVS507ALZk0rdV78Eg9EQt1z274clNydGCjVXzn12x6mqq+Hvzia1/hoy8UIO 5OM0A0IYrhuoGOeFXhTLaU/4dNnB3WKodDlAhp10md5xwUcbMv2UuV7wLGmbUirhik dU5LBytaikQfA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 92248180068 for ; Tue, 18 Feb 2025 14:38:41 +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=-2.0 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (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 14:38:41 +0000 (UTC) Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6e67ce516efso17419756d6.3 for ; Tue, 18 Feb 2025 06:41:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunglas.fr; s=google; t=1739889681; x=1740494481; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=3WmjctCLzqQrUTMBjIHlgFYWyGLAfuOFIi48yv85kZw=; b=cojN1qgeDthWizIdojgP3SuEWUGmKJ4Wv99uXERV6+LKPoI/hAAa3ZC0zsJq6oidOI WFjMRvj1pRW7b/Nev5rBy7ll1knS0nHjJmIqJA36s75tBx+r0DIn+QJyFJq4laS9b/HS Kx/BH/3vfUviFqKIh0MzlVhNi962VFJVawCeeYD0yuYKKr43U179U7wi0DyJgHd60ziZ 9tLnviMpAsQG374DNtDbf+wa4MCx24cbgHHlP28HcptpSYTXpd6tE5fGBQgq5024HFdC PB3VKa8p2R+XsEakqQVs5b3eU7DSZRi4VwvoqcOfFKSdrnPwrUBiGXGL2BRkJDv2owaX 3CWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739889681; x=1740494481; h=cc: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=3WmjctCLzqQrUTMBjIHlgFYWyGLAfuOFIi48yv85kZw=; b=B9wdQBaok6j9Xo1pW/FVBX4tsAa2KJrpCd7ZLpeYfmnCZ4Xg3K/pdLRYeCaeo+h6mU xc4xOfpR514n8XoVvV7Cd6uNdYyRystjlpKlX5qOcNI+qYsdymAZgrHX05BVjHCBmnbO EZj/F8Fpl8FlyI59/NjyC7zHHGBW40Y3hposwdAX9vIaAAR7yuspzcVdFNc3qBPlR90E zDhNsubvpnYO1PbfU6pb172WCS8dW7vOPKAaTvXNkf2cq6a2sxulYxHDaUSwyjM9ofXJ mo6T8JKXXEXe7/AQH0HXAUtBdIExvLbxat7QcKmObzQp04lyw2JthBdZxrCnjNwYTo2p QGVw== X-Forwarded-Encrypted: i=1; AJvYcCUkDAPivGswGjC/R1bUlonwgFITVSQl+Ca45IMCawGF3afOhtOtvqDPYKUQq/FoOggjBhKzwdoOCNU=@lists.php.net X-Gm-Message-State: AOJu0YxN469cAiKpu5Q+HPruXKZTMhkou5SdfVkca45BvqkWqspvZbnC oExzuoRfL1QkKyxTplrzW7bMWvBcN8k9HmX4BbErrGJAjBgjO19ZJ8+OeRxcNXMSgel6VNyCKv4 hGBb5b1OL7MrdX+8/TcwafqVT2DfkKaEKYNZOPN62XsWWsZyv/PBpwA== X-Gm-Gg: ASbGncu1hQUsdMl2l6EVVp9jcXAURshcnKJpg2bpg56ga7NdRrmx/O7yaJHFcw+qKyX ETKbuDWgb2dUtpo4XFEQxqNE8oqQH9hdJ9460poLrYdp7mHk1POEJRbyb8ueVdD4t22xT6ADl7g == X-Google-Smtp-Source: AGHT+IGA4wcDadNtu+MQ+a3bM2AU2lr8ERmq+VzZbpbVGj4VWs6R/GXRElVWzrqXnoonEn8teXNcNKPwPlgeiHt4sAA= X-Received: by 2002:a05:6214:d64:b0:6d4:215d:91b5 with SMTP id 6a1803df08f44-6e66ccbc924mr170685786d6.11.1739889681590; Tue, 18 Feb 2025 06:41:21 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <528e16e1-1fb3-448a-b187-7cc84e1bcc4a@seld.be> <5fa7423e-d723-451e-a73d-a98512a6ca96@seld.be> <8256945f09944cb16db34fd8139da63e@bastelstu.be> <1856be6ad7a51bf5ea56001eb719897a@bastelstu.be> In-Reply-To: <1856be6ad7a51bf5ea56001eb719897a@bastelstu.be> Date: Tue, 18 Feb 2025 15:41:09 +0100 X-Gm-Features: AWEUYZm3kuSVTNeKmKLuZX1L-bkqnyG0vgZaQjHCfsLON70s1dPtwOpQATEdxT0 Message-ID: Subject: Re: [PHP-DEV] [RFC] Modern Compression (zstd, brotli) To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: Paul Dragoonis , Jordi Boggiano , Internals Content-Type: multipart/alternative; boundary="0000000000006b8798062e6ba2a5" From: kevin@dunglas.fr (=?UTF-8?Q?K=C3=A9vin_Dunglas?=) --0000000000006b8798062e6ba2a5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi there, Here is an alternative proposal we just discussed with Jordi: First, reduce the scope of our RFC to simply add new stream wrappers for Zstandard and Brotli similar to those already provided for zlib: https://www.php.net/manual/en/wrappers.compression.php PECL extensions for Brotli and Zstandard already provide these wrappers, and Symfony AssetMapper uses them when available. To keep things moving quickly, we won't be adding any new functions or classes (perhaps just constants or enums for context options). To use these new formats, we'll need to use the low-level file/stream manipulation functions. It will be possible to provide userland libraries with a more attractive API. As a second step, in a future RFC, we could create a new "Compress" interface (or class) similar to that implemented by Go's "compress" module = ( https://pkg.go.dev/compress) or Java's InputStream/OutputStream abstraction ( https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/io/InputS= tream.html / https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/io/Output= Stream.html), which would offer a high-level API for compressing or decompressing files, and which would use stream wrappers under the hood. In this way, we can move ahead quickly and quickly provide support for Brotli and Zstandard, which we urgently need to support natively for Composer, Symfony, and probably many other projects, and we can take the time to think about a well-designed high-level API. -- K=C3=A9vin Dunglas https://dunglas.dev --0000000000006b8798062e6ba2a5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi there,

Here i= s an alternative proposal we just discussed with Jordi:

First, reduc= e the scope of our RFC to simply add new stream wrappers for Zstandard and = Brotli similar to those already provided for zlib: https://www.php.net/manual/en/wr= appers.compression.php

PECL extensions for Brotli and Zstandard = already provide these wrappers, and Symfony AssetMapper uses them when avai= lable.

To keep things moving quickly, we won't be adding any new= functions or classes (perhaps just constants or enums for context options)= .

To use these new formats, we'll need to use the low-level file= /stream manipulation functions. It will be possible to provide userland lib= raries with a more attractive API.

As a second step, in a future RFC= , we could create a new "Compress" interface (or class) similar t= o that implemented by Go's "compress" module (https://pkg.go.dev/compress) or Java's Inp= utStream/OutputStream abstraction (https://docs.orac= le.com/en/java/javase/23/docs/api/java.base/java/io/InputStream.html / = https://docs.oracle.com/en/java/javase/23/docs/api/= java.base/java/io/OutputStream.html), which would offer a high-level AP= I for compressing or decompressing files, and which would use stream wrappe= rs under the hood.

In this way, we can move ahead quickly and quickl= y provide support for Brotli and Zstandard, which we urgently need to suppo= rt natively for Composer, Symfony, and probably many other projects, and we= can take the time to think about a well-designed high-level API.

--
K=C3=A9vin Dunglas

--0000000000006b8798062e6ba2a5--