waltertamboer/pharcompiler 问题修复 & 功能扩展

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

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

waltertamboer/pharcompiler

Composer 安装命令:

composer require waltertamboer/pharcompiler

包简介

A PHAR compiler for PHP.

README 文档

README

Build Status

PharCompiler is a compiler to easily create PHAR files. The concept is that you create a new instance of the compiler to which you give the name of the PHAR file. Next you add the files that should be packed into the archive and last you call compile.

Compiling

Compiling a .phar file is easy.

<?php

// build.php:
$compiler = new \WT\PharCompiler\Compiler('my.phar');
$compiler->setVariable('package_version', '1.0.0');
$compiler->addFile(__DIR__ . '/src/test.php');
$compiler->compile();

By using addFile and addDirectory you can add a list of files to the archive.

Meta Data Variables

It's possible to add meta data to the compiler. This meta data is injected in the source files. For example:

<?php

// build.php:
$compiler = new \WT\PharCompiler\Compiler();
$compiler->setVariable('package_version', '1.0.0');
$compiler->addFile(__DIR__ . '/src/test.php');
$compiler->compile();
<?php

// test.php:

echo 'Version: @package_version@';

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-01-06