Skip to content

Add brotli compress/uncompress functions to PHP

License

Notifications You must be signed in to change notification settings

nlemoine/brotli-php

 
 

Repository files navigation

PHP unit tests Packagist Downloads

This library adds Brotli support to PHP. 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 n5s/brotli

Binaries

brotli is not available on your system/server

Prebuilt binaries included for the following systems:

  • Linux (x86_64/i386)
  • Mac OS
  • Windows

brotli is available on your system/server

If brotli is available on your server, you set its path using:

\n5s\Brotli\Brotli::setBinaryPath('brotli');

or

\n5s\Brotli\Brotli::setBinaryPath('/some/dir/brotli');

Tests

composer test

About

Add brotli compress/uncompress functions to PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%