vdechenaux / brotli
为PHP添加brotli压缩/解压缩功能
1.2.0
2022-10-15 18:54 UTC
Requires
- php: ^7.4 || ^8.0
- symfony/process: ^4.4.30|^5.3.7|^6.0
Requires (Dev)
- phpunit/phpunit: ^9.3
Suggests
- vdechenaux/brotli-bin-amd64: Brotli binary for Linux amd64
- vdechenaux/brotli-bin-i386: Brotli binary for Linux i386
This package is auto-updated.
Last update: 2024-09-15 22:57:30 UTC
README
特性
此库为PHP(>=7.4)添加Brotli支持
function brotli_compress(string $data, int $quality = 11): string function brotli_uncompress(string $data): string
安装
库
$ composer require vdechenaux/brotli
你几乎完成了! 阅读下一部分以完成配置。
二进制文件
此命令将仅安装PHP代码,但还需要一个二进制文件。这个二进制文件由两个包提供,具体取决于你的环境
- Linux AMD64
$ composer require vdechenaux/brotli-bin-amd64
- Linux i386
$ composer require vdechenaux/brotli-bin-i386
此库将自动使用此二进制文件。在二进制文件安装后,你不需要进行任何配置。
使用apt
如果你使用的是
- Ubuntu >= xenial (16.04)
- Debian >= stretch (9)
$ apt install brotli
使用Homebrew
$ brew install brotli