lkeme/brotli

Add brotli compress/uncompress functions to PHP. Batteries included.

dev-master 2022-08-27 04:33 UTC

This package is auto-updated.

Last update: 2024-10-27 09:06:37 UTC


README

GitHub Workflow Status

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:

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