https://github.com/waltertamboer/pharcompiler
A compiler to create PHAR files.
https://github.com/waltertamboer/pharcompiler
compiler phar php
Last synced: 14 days ago
JSON representation
A compiler to create PHAR files.
- Host: GitHub
- URL: https://github.com/waltertamboer/pharcompiler
- Owner: waltertamboer
- Created: 2013-01-06T16:37:31.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-12-11T19:47:15.000Z (over 12 years ago)
- Last Synced: 2025-01-19T19:49:20.873Z (over 1 year ago)
- Topics: compiler, phar, php
- Language: PHP
- Size: 264 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PharCompiler
============
[](https://travis-ci.org/WalterTamboer/pharcompiler)
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.
```
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:
```
setVariable('package_version', '1.0.0');
$compiler->addFile(__DIR__ . '/src/test.php');
$compiler->compile();
```
```