本文整理汇总了PHP中Phar::startBuffering方法的典型用法代码示例。如果您正苦于以下问题:PHP Phar::startBuffering方法的具体用法?PHP Phar::startBuffering怎么用?PHP Phar::startBuffering使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phar
的用法示例。
在下文中一共展示了Phar::startBuffering方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compile
/**
* Compiles composer into a single phar file
*
* @throws \RuntimeException
*
* @param string $pharFile The full path to the file to create
*/
public function compile($pharFile = 'swagger.phar')
{
if (file_exists($pharFile)) {
unlink($pharFile);
}
$this->version = trim(file_get_contents(dirname(__DIR__ . '/VERSION')));
$phar = new \Phar($pharFile, 0, 'swagger.phar');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->notName('Compiler.php')->notName('ClassLoader.php')->notPath('vendor/symfony')->notPath('tests')->in(dirname(__DIR__) . '/');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$this->addFile($phar, new \SplFileInfo(dirname(__DIR__) . '/vendor/autoload.php'));
$this->addFile($phar, new \SplFileInfo(dirname(__DIR__) . '/vendor/composer/autoload_namespaces.php'));
$this->addFile($phar, new \SplFileInfo(dirname(__DIR__) . '/vendor/composer/autoload_classmap.php'));
$this->addFile($phar, new \SplFileInfo(dirname(__DIR__) . '/vendor/composer/ClassLoader.php'));
$this->addSwaggerBin($phar);
$phar->setStub($this->getStub());
$phar->stopBuffering();
$this->addFile($phar, new \SplFileInfo(dirname(__DIR__) . '/LICENSE-2.0.txt'), false);
$this->addFile($phar, new \SplFileInfo(dirname(__DIR__) . '/VERSION'), false);
unset($phar);
}
示例2: compile
public function compile($pharFile = 'already-extract.phar')
{
if (file_exists($pharFile)) {
unlink($pharFile);
}
$phar = new \Phar($pharFile, 0, 'already-extract.phar');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->notName('Compiler.php')->in(__DIR__ . '/..');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->exclude('Tests')->in(__DIR__ . '/../../vendor/symfony/');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/autoload.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_namespaces.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_psr4.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_classmap.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_real.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/ClassLoader.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/include_paths.php'));
$this->addAlreadyExtractBin($phar);
$phar->setStub($this->getStub());
$phar->stopBuffering();
unset($phar);
}
示例3: compile
/**
* Compiles psysh into a single phar file
*
* @param string $pharFile The full path to the file to create
*/
public function compile($pharFile = 'psysh.phar')
{
if (file_exists($pharFile)) {
unlink($pharFile);
}
$this->version = Shell::VERSION;
$phar = new \Phar($pharFile, 0, 'psysh.phar');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->notName('Compiler.php')->notName('Autoloader.php')->in(__DIR__ . '/..');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->exclude('Tests')->in(__DIR__ . '/../../vendor/symfony/')->in(__DIR__ . '/../../vendor/nikic/');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/autoload.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/include_paths.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_real.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_namespaces.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_classmap.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/ClassLoader.php'));
$this->addPsyshBin($phar);
// Stubs
$phar->setStub($this->getStub());
$phar->stopBuffering();
// $this->addFile($phar, new \SplFileInfo(__DIR__.'/../../LICENSE'), false);
unset($phar);
}
示例4: compile
/**
* Compiles the Hydra source code into one single Phar file.
*
* @param string $pharFile Name of the output Phar file
*/
public function compile($pharFile = 'hydra.phar')
{
if (file_exists($pharFile)) {
unlink($pharFile);
}
$phar = new \Phar($pharFile, 0, 'hydra.phar');
$phar->startBuffering();
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->name('*.twig')->notName('PharCompiler.php')->exclude('Tests')->in('src')->in('views')->in('../../twig/twig/lib')->in('../../monolog/monolog/src')->in('../../symfony/http-kernel/Symfony/Component/HttpKernel/Exception')->in('../../symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType')->in('../../symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$this->addFile($phar, new \SplFileInfo('../../symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php'));
$this->addFile($phar, new \SplFileInfo('../../symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php'));
$this->addFile($phar, new \SplFileInfo('../../symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php'));
$this->addFile($phar, new \SplFileInfo('../../symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php'));
$this->addFile($phar, new \SplFileInfo('../../symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php'));
$this->addFile($phar, new \SplFileInfo('../../autoload.php'));
$this->addFile($phar, new \SplFileInfo('../../composer/ClassLoader.php'));
$this->addFile($phar, new \SplFileInfo('../../composer/autoload_namespaces.php'));
$this->addFile($phar, new \SplFileInfo('../../composer/autoload_classmap.php'));
$phar->setStub($this->getStub());
$phar->stopBuffering();
// $phar->compressFiles(\Phar::GZ);
}
示例5: _build
protected static function _build($conf)
{
$pathToPhar = $conf['path_to_phar'];
$pharName = $conf['phar_name'];
$srcPath = $conf['src_path'];
$initModule = $conf['init_module'];
$setup = $conf['setup'];
$file = $pathToPhar . '/' . $pharName;
if ($conf['delete_old_phar_onbuild'] && \file_exists($file)) {
\unlink($file);
}
$falias = $pharName;
$mapPhar = $pharName;
$phar = new \Phar($file, 0, $falias);
$phar->startBuffering();
$dir = $phar->buildFromDirectory($srcPath);
$stub = '<?php ' . "\\Phar::mapPhar('{$falias}'); " . 'include ' . "'phar://{$falias}/{$initModule}'; " . "{$setup}" . '__HALT_COMPILER();';
$phar->setStub($stub);
//
//
if (isset($conf['compress_pkg']) && $conf['compress_pkg'] == 'GZ') {
$phar->compressFiles(\Phar::GZ);
}
//
//
$phar->stopBuffering();
}
示例6: makePlugin
/**
* Makes a .phar packaged PocketMine plugin from a source directory.
*
* @param $sourcePath
* @param $pharOutputLocation
* @param $options
* @return bool
* @throws \Exception
*/
public static function makePlugin($sourcePath, $pharOutputLocation, $options)
{
/* Removes Leading '/' */
$sourcePath = rtrim(str_replace("\\", "/", realpath($sourcePath)), "/") . "/";
$description = self::getPluginDescription($sourcePath . "/plugin.yml");
if ($options & self::MAKEPLUGIN_REAL_OUTPUT_PATH) {
$pharPath = $pharOutputLocation;
} else {
$pharPath = $pharOutputLocation . DIRECTORY_SEPARATOR . $description->getName() . "_v" . $description->getVersion() . ".phar";
}
if (file_exists($pharPath)) {
throw new \Exception("Phar path already exists");
}
$phar = new \Phar($pharPath);
$phar->setMetadata(["name" => $description->getName(), "version" => $description->getVersion(), "main" => $description->getMain(), "api" => $description->getCompatibleApis(), "depend" => $description->getDepend(), "description" => $description->getDescription(), "authors" => $description->getAuthors(), "website" => $description->getWebsite(), "creationDate" => time()]);
$phar->setStub('<?php echo "PocketMine-MP plugin ' . $description->getName() . ' v' . $description->getVersion() . '\\nThis file has been generated using DevTools v' . self::getVersion() . ' at ' . date("r") . '\\n----------------\\n";if(extension_loaded("phar")){$phar = new \\Phar(__FILE__);foreach($phar->getMetadata() as $key => $value){echo ucfirst($key).": ".(is_array($value) ? implode(", ", $value):$value)."\\n";}} __HALT_COMPILER();');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($sourcePath)) as $file) {
$path = ltrim(str_replace(["\\", $sourcePath], ["/", ""], $file), "/");
if ($path[0] === "." or strpos($path, "/.") !== false) {
continue;
}
$phar->addFile($file, $path);
}
if ($options * self::MAKEPLUGIN_COMPRESS) {
$phar->compressFiles(\Phar::GZ);
}
$phar->stopBuffering();
return true;
}
示例7: compile
public function compile()
{
if (file_exists('symfony.phar')) {
unlink('symfony.phar');
}
$phar = new \Phar('symfony.phar', 0, 'Symfony');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
// Files
foreach ($this->getFiles() as $file) {
$path = str_replace(__DIR__ . '/', '', $file);
if (false !== strpos($file, '.php')) {
$content = Kernel::stripComments(file_get_contents($file));
} else {
$content = file_get_contents($file);
}
$phar->addFromString($path, $content);
}
// Stubs
$phar['_cli_stub.php'] = $this->getCliStub();
$phar['_web_stub.php'] = $this->getWebStub();
$phar->setDefaultStub('_cli_stub.php', '_web_stub.php');
$phar->stopBuffering();
//$phar->compressFiles(\Phar::GZ);
unset($phar);
}
示例8: compile
/**
* Compiles the Cilex source code into one single Phar file.
*
* @param string $pharFile Name of the output Phar file
*/
public function compile($pharFile = 'cilex.phar')
{
if (file_exists($pharFile)) {
unlink($pharFile);
}
$process = new Process('git log --pretty="%h %ci" -n1 HEAD');
if ($process->run() > 0) {
throw new \RuntimeException('The git binary cannot be found.');
}
$this->version = trim($process->getOutput());
$phar = new \Phar($pharFile, 0, 'cilex.phar');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->notName('Compiler.php')->in(__DIR__ . '/..')->in(__DIR__ . '/../../vendor/pimple/pimple/lib')->in(__DIR__ . '/../../vendor/symfony/class-loader/Symfony/Component/ClassLoader')->in(__DIR__ . '/../../vendor/symfony/console/Symfony/Component/Console');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../LICENSE'), false);
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/autoload.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/ClassLoader.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_real.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_namespaces.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_classmap.php'));
// Stubs
$phar->setStub($this->getStub());
$phar->stopBuffering();
// $phar->compressFiles(\Phar::GZ);
unset($phar);
}
示例9: compile
/**
* Compiles psysh into a single phar file.
*
* @param string $pharFile The full path to the file to create
*/
public function compile($pharFile = 'psysh.phar')
{
if (file_exists($pharFile)) {
unlink($pharFile);
}
$this->version = Shell::VERSION;
$phar = new \Phar($pharFile, 0, 'psysh.phar');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
$finder = Finder::create()->files()->ignoreVCS(true)->name('*.php')->notName('Compiler.php')->notName('Autoloader.php')->in(__DIR__ . '/..');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$finder = Finder::create()->files()->ignoreVCS(true)->name('*.php')->exclude('Tests')->in(__DIR__ . '/../../vendor/dnoegel/php-xdg-base-dir/src')->in(__DIR__ . '/../../vendor/jakub-onderka/php-console-color')->in(__DIR__ . '/../../vendor/jakub-onderka/php-console-highlighter')->in(__DIR__ . '/../../vendor/nikic/php-parser/lib')->in(__DIR__ . '/../../vendor/symfony/console')->in(__DIR__ . '/../../vendor/symfony/var-dumper')->in(__DIR__ . '/../../vendor/symfony/yaml');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/autoload.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/include_paths.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_files.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_psr4.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_real.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_namespaces.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_classmap.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/ClassLoader.php'));
// Stubs
$phar->setStub($this->getStub());
$phar->stopBuffering();
// $this->addFile($phar, new \SplFileInfo(__DIR__.'/../../LICENSE'), false);
unset($phar);
}
示例10: compile
/**
* Compiles phar archive.
*
* @param string $version
*/
public function compile($version)
{
if (file_exists($package = "behat-{$version}.phar")) {
unlink($package);
}
// create phar
$phar = new \Phar($package, 0, 'behat.phar');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->name('*.xsd')->name('*.xml')->name('LICENSE')->notName('PharCompiler.php')->notName('PearCompiler.php')->in($this->libPath . '/src')->in($this->libPath . '/vendor');
foreach ($finder as $file) {
// don't compile test suites
if (!preg_match('/\\/tests\\/|\\/test\\//i', $file->getRealPath())) {
$this->addFileToPhar($file, $phar);
}
}
// license and autoloading
$this->addFileToPhar(new \SplFileInfo($this->libPath . '/LICENSE'), $phar);
$this->addFileToPhar(new \SplFileInfo($this->libPath . '/i18n.php'), $phar);
// stub
$phar->setStub($this->getStub($version));
$phar->stopBuffering();
unset($phar);
}
示例11: compile
/**
* Compiles the Silex source code into one single Phar file.
*
* @param string $pharFile Name of the output Phar file
*/
public function compile($pharFile = 'silex.phar')
{
if (file_exists($pharFile)) {
unlink($pharFile);
}
$process = new Process('git log --pretty="%h %ci" -n1 HEAD');
if ($process->run() > 0) {
throw new \RuntimeException('The git binary cannot be found.');
}
$this->version = trim($process->getOutput());
$phar = new \Phar($pharFile, 0, 'silex.phar');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->notName('Compiler.php')->in(__DIR__ . '/..')->in(__DIR__ . '/../../vendor/pimple/pimple/lib')->in(__DIR__ . '/../../vendor/symfony/class-loader/Symfony/Component/ClassLoader')->in(__DIR__ . '/../../vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher')->in(__DIR__ . '/../../vendor/symfony/http-foundation/Symfony/Component/HttpFoundation')->in(__DIR__ . '/../../vendor/symfony/http-kernel/Symfony/Component/HttpKernel')->in(__DIR__ . '/../../vendor/symfony/routing/Symfony/Component/Routing')->in(__DIR__ . '/../../vendor/symfony/browser-kit/Symfony/Component/BrowserKit')->in(__DIR__ . '/../../vendor/symfony/css-selector/Symfony/Component/CssSelector')->in(__DIR__ . '/../../vendor/symfony/dom-crawler/Symfony/Component/DomCrawler');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../LICENSE'), false);
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/.composer/autoload.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/.composer/ClassLoader.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/.composer/autoload_namespaces.php'));
// Stubs
$phar->setStub($this->getStub());
$phar->stopBuffering();
// $phar->compressFiles(\Phar::GZ);
unset($phar);
}
示例12: compile
public function compile($pharFile = 'onesky.phar')
{
if (file_exists($pharFile)) {
unlink($pharFile);
}
$phar = new \Phar($pharFile, 0, 'onesky.phar');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
$finders = array();
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->notName('Compiler.php')->in(__DIR__);
$finders[] = $finder;
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->in(dirname(__DIR__) . "/vendor");
$finders[] = $finder;
foreach ($finders as $finder) {
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
}
$this->addBin($phar);
// Stubs
$phar->setStub($this->getStub());
$phar->stopBuffering();
$phar->compressFiles(\Phar::GZ);
unset($phar);
}
示例13: compile
/**
* Compiles satis into a single phar file
*
* @param string $pharFile The full path to the file to create
*
* @throws \RuntimeException
*/
public function compile($pharFile = 'satis.phar')
{
if (file_exists($pharFile)) {
unlink($pharFile);
}
$phar = new \Phar($pharFile, 0, 'satis.phar');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
$finders = array();
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->notName('Compiler.php')->in(__DIR__ . '/../../');
$finders[] = $finder;
$finder = new Finder();
$finder->files()->name('*')->in(__DIR__ . '/../../../views/');
$finders[] = $finder;
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->name('composer-schema.json')->exclude(array('phpunit', 'mikey179', 'phpdocumentor', 'sebastian', 'phpspec', 'doctrine', 'test', 'tests', 'Tests'))->in(__DIR__ . '/../../../vendor/');
$finders[] = $finder;
foreach ($finders as $finder) {
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
}
$this->addSatisBin($phar);
// Stubs
$phar->setStub($this->getStub());
$phar->stopBuffering();
$phar->compressFiles(\Phar::GZ);
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../../LICENSE'), false);
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../../res/satis-schema.json'), false);
unset($phar);
}
示例14: compile
/**
* Compiles composer into a single phar file
*
* @throws \RuntimeException
* @param string $pharFile The full path to the file to create
*/
public function compile($pharFile = 'composer.phar')
{
if (file_exists($pharFile)) {
unlink($pharFile);
}
$process = new Process('git log --pretty="%h" -n1 HEAD');
if ($process->run() != 0) {
throw new \RuntimeException('The git binary cannot be found.');
}
$this->version = trim($process->getOutput());
$phar = new \Phar($pharFile, 0, 'composer.phar');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->notName('Compiler.php')->in(__DIR__ . '/..');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->in(__DIR__ . '/../../vendor/symfony/');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/.composer/ClassLoader.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/.composer/autoload.php'));
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/.composer/autoload_namespaces.php'));
$this->addComposerBin($phar);
// Stubs
$phar->setStub($this->getStub());
$phar->stopBuffering();
// disabled for interoperability with systems without gzip ext
// $phar->compressFiles(\Phar::GZ);
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../LICENSE'), false);
unset($phar);
}
示例15: compile
/**
* Compiles composer into a single phar file
*
* @throws \RuntimeException
*/
public function compile()
{
$pharFile = 'refactor.phar';
if (file_exists($pharFile)) {
unlink($pharFile);
}
$process = new Process('git log --pretty="%H" -n1 HEAD', $this->directory);
if ($process->run() != 0) {
throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from git repository clone and that git binary is available.');
}
$this->version = trim($process->getOutput());
$process = new Process('git describe --tags HEAD');
if ($process->run() == 0) {
$this->version = trim($process->getOutput());
}
$phar = new \Phar($pharFile, 0, 'refactor.phar');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->notName('Compiler.php')->in($this->directory . '/src/main');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$finder = new Finder();
$finder->files()->ignoreVCS(true)->name('*.php')->exclude('test')->exclude('features')->in($this->directory . '/vendor/');
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
$this->addRefactorBin($phar);
// Stubs
$phar->setStub($this->getStub());
$phar->stopBuffering();
unset($phar);
}