lkeme / brotli
Add brotli compress/uncompress functions to PHP. Batteries included.
dev-master
2022-08-27 04:33 UTC
Requires
- php: ^7.4 || ^8.0
- loophp/phposinfo: ^1.7
- symfony/process: ^5.0 || ^6.0
Requires (Dev)
- phpunit/phpunit: ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-10-27 09:06:37 UTC
README
This library adds Brotli support to PHP (^7.4 || ^8.0). Batteries included.
function brotli_compress(string $data, int $quality = 11): string function brotli_uncompress(string $data): string
It is a fork of vdechenaux/brotli-php. Main differences:
- avoid usage of
ob_start
in\Symfony\Component\Process\Process
so you can use it inside anob_start
callback. - comes with prebuilt binaries and automatic system guessing
Installation
$ composer require hellonico/brotli
Binaries
brotli
is not available on your system/server
Prebuilt binaries included for the following systems:
- Linux (x86_64/i386/aarch64/armv7)
- Mac OS
- Windows
brotli
is available on your system/server
If brotli
is available on your server, you set its path using:
\HelloNico\Brotli\Brotli::setBinaryPath('brotli');
or
\HelloNico\Brotli\Brotli::setBinaryPath('/some/dir/brotli');
Tests
composer test