2017 © Pedro Peláez
 

library pharcompiler

A PHAR compiler for PHP.

image

waltertamboer/pharcompiler

A PHAR compiler for PHP.

  • Wednesday, December 11, 2013
  • by waltertamboer
  • Repository
  • 1 Watchers
  • 3 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PharCompiler

Build Status, (*1)

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., (*2)

Compiling

Compiling a .phar file is easy., (*3)

<?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., (*4)

Meta Data Variables

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

<?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@';

The Versions

11/12 2013

dev-master

9999999-dev https://github.com/WalterTamboer/pharcompiler

A PHAR compiler for PHP.

  Sources   Download

MIT

The Requires

 

php phar compiler