Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/waltertamboer/pharcompiler

A compiler to create PHAR files.
https://github.com/waltertamboer/pharcompiler

compiler phar php

Last synced: 26 days ago
JSON representation

A compiler to create PHAR files.

Awesome Lists containing this project

README

        

PharCompiler
============

[![Build Status](https://travis-ci.org/WalterTamboer/pharcompiler.png)](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();
```

```