2017 © Pedro Peláez
 

library php-ext-brotli

Brotli Extension for PHP, Documentation for Brotli can be found at https://github.com/google/brotli/.

image

mackjoner/php-ext-brotli

Brotli Extension for PHP, Documentation for Brotli can be found at https://github.com/google/brotli/.

  • Tuesday, February 6, 2018
  • by mackjoner
  • Repository
  • 0 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Brotli Extension for PHP

Build Status, (*1)

This extension allows Brotli compression., (*2)

Documentation for Brotli can be found at » https://github.com/google/brotli/., (*3)

Build

% git clone --recursive --depth=1 https://github.com/kjdev/php-ext-brotli.git
% cd php-ext-brotli
% phpize
% ./configure
% make
$ make install

To use the system library (using pkg-config), (*4)

``` bash % ./configure --with-libbrotli, (*5)


## Distribution binary packages ### Fedora / CentOS / RHEL RPM packages of this extension are available in [» Remi's RPM repository](https://rpms.remirepo.net/) and are named **php-brotli**. ## Configuration brotli.ini:

extension=brotli.so, (*6)


## Function * brotli\_compress — Compress a string * brotli\_uncompress — Uncompress a compressed string ## brotli\_compress — Compress a string ### Description string **brotli\_compress** ( string _$data_ [, int _$quality_ = 11, int _$mode_ = -1 ] ) This function compress the given string using the ZLIB data format. ### Parameters * _data_ The data to compress. * _quality_ The higher the quality, the slower the compression. (Defaults to 11) * _mode_ The compression mode can be `BROTLI_GENERIC` (default), `BROTLI_TEXT` (for UTF-8 format text input) or `BROTLI_FONT` (for WOFF 2.0). ### Return Values The compressed string or FALSE if an error occurred. ### brotli\_uncompress — Uncompress a compressed string ### Description string **brotli\_uncompress** ( string _$data_ [, int _$length_ = 0 ] ) This function uncompress a compressed string. ### Parameters * _data_ The data compressed by brotli\_compress(). * _length_ The maximum length of data to decode. ### Return Values The original uncompressed data or FALSE on error. ## Examples

$compressed = brotli_compress('Compresstest');, (*7)

$uncompressed = brotli_uncompress($compressed);, (*8)

echo $uncompressed; ```, (*9)

The Versions

06/02 2018

dev-master

9999999-dev

Brotli Extension for PHP, Documentation for Brotli can be found at https://github.com/google/brotli/.

  Sources   Download

The Requires

  • php ^5.3.3 || ^7.0