ebidtech/compress
最新稳定版本:v1.1.1
Composer 安装命令:
composer require ebidtech/compress
包简介
Compress library
README 文档
README
Simple wrapper that provides a common interface for data compression. Making easy to change the compression algorithm and use a common interface.
Requirements
- PHP >= 5.4
Installation
The recommended way to install is through composer.
Just create a composer.json file for your project:
{
"require": {
"ebidtech/compress": "@stable"
}
}
Tip: browse ebidtech/compress page to choose a stable version to use, avoid the @stable meta constraint.
And run these two commands to install it:
$ curl -sS https://getcomposer.org/installer | php
$ composer install
Now you can add the autoloader, and you will have access to the library:
<?php require 'vendor/autoload.php';
Usage
Builder
use EBT\Compress\CompressBuilder; $compressor = CompressBuilder::create()->get('gzencode'); $compressedData = $compressor->compress('some text'); echo $compressor->uncompress($compressedData); // will print 'some text'
Regular way
use EBT\Compress\GzcompressCompressor as Compressor; $compressor = new Compressor(); $compressedData = $compressor->compress('some text'); echo $compressor->uncompress($compressedData); // will print 'some text'
Traits
use EBT\Compress\GzcompressCompressorTrait as CompressorTrait; class Test { use CompressorTrait; public function test() { $compressedData = $this->compress('test'); echo $this->uncompress($compressedData); // will print 'some text' } }
Contributing
See CONTRIBUTING file.
Credits
- Ebidtech developer team, compress Lead developer Eduardo Oliveira (eduardo.oliveira@ebidtech.com).
- All contributors
License
Compress library is released under the MIT License. See the bundled LICENSE file for details.
统计信息
- 总下载量: 10.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-11-25