addvilz / pharaoh
简化 .phar 构建脚本的库
v1.0.3
2016-02-07 01:33 UTC
Requires
- symfony/finder: >2.6
This package is not auto-updated.
Last update: 2024-09-14 18:36:56 UTC
README
简化 .phar 构建脚本的库。
用法
创建一个新文件,例如,build.php
#!/usr/bin/env php
<?php
$composer = (new \Symfony\Component\Finder\Finder())
->files()
->ignoreVCS(true)
->name('*.php')
->exclude(['test', 'tests', 'spec'])
->in(__DIR__ . '/vendor/');
$src = (new \Symfony\Component\Finder\Finder())
->files()
->ignoreVCS(true)
->name('*.php')
->in(__DIR__ . '/src/');
$builder = (new \Addvilz\Pharaoh\Builder('myapp.phar', __DIR__, __DIR__))
->addFinder($composer)
->addFinder($src)
// ->addFile('LICENSE')
// ->addFile('README.md')
->build('index.php') // file that contains the "index" code of your app
;