phine/phar-compact 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phine/phar-compact

最新稳定版本:1.0.0

Composer 安装命令:

composer require phine/phar-compact

包简介

Integrates the compact library with the phar library.

README 文档

README

Build Status Coverage Status Latest Stable Version Total Downloads

Integrates the compact library with the phar library.

Requirement

Installation

Via Composer:

$ composer require "phine/phar-compact=~1.0"

Usage

The library provides a single subject observer for lib-phar. This observer can be registered to the following subjects in order to compact file contents as they are being added to the archive:

  • Builder::ADD_FILE
  • Builder::ADD_STRING

To create an observer, you will need a new instance of CompactObserver.

use Phine\Compact;
use Phine\Compact\Collection;
use Phine\Phar\Builder;
use Phine\Phar\Compact\CompactObserver;

// create the archive builder
$builder = Builder::create('example.phar');

// create the collection of compactors
$collection = new Collection();
$collection->addCompactor(new Compact\Json());
$collection->addCompactor(new Compact\Php());
$collection->addCompactor(new Compact\Xml());

// create the compactor observer
$observer = new CompactObserver($collection);

// register it with the builder subjects
$builder->observe(Builder::ADD_FILE, $observer);
$builder->observe(Builder::ADD_STRING, $observer);

With the observer registered, any time a file is added to the archive via the addFile() or addFromString() methods, the contents of the supported file types will be automatically compacted before being added to the archive.

Documentation

You can find the API documentation here.

License

This library is available under the MIT license.

统计信息

  • 总下载量: 551
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-01-08