https://github.com/secondtruth/php-phar-compiler
📦 A generic PHP PHAR compiler
https://github.com/secondtruth/php-phar-compiler
composer-package phar phar-compiler phar-generator php php-library
Last synced: 4 months ago
JSON representation
📦 A generic PHP PHAR compiler
- Host: GitHub
- URL: https://github.com/secondtruth/php-phar-compiler
- Owner: secondtruth
- License: mit
- Created: 2014-12-14T19:25:17.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2021-03-16T15:33:29.000Z (almost 5 years ago)
- Last Synced: 2025-10-13T01:26:30.222Z (4 months ago)
- Topics: composer-package, phar, phar-compiler, phar-generator, php, php-library
- Language: PHP
- Homepage: https://www.secondtruth.de
- Size: 26.4 KB
- Stars: 26
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
PHP PHAR Compiler
=================
[](https://packagist.org/p/secondtruth/phar-compiler)
[](https://travis-ci.com/github/secondtruth/php-phar-compiler)
[](https://scrutinizer-ci.com/g/secondtruth/php-phar-compiler)
[](https://scrutinizer-ci.com/g/secondtruth/php-phar-compiler)
[](https://packagist.org/p/secondtruth/phar-compiler)
This library provides a generic PHP PHAR compiler.
How to use?
-----------
```php
$compiler = new Compiler(PROJECT_PATH);
$compiler->addIndexFile('bin/mycoolprogram.php');
$compiler->addDirectory('libraries');
$compiler->addFile('vendor/autoload.php');
$compiler->addDirectory('vendor/composer', '!*.php'); // Exclude non-PHP files
$compiler->addDirectory('vendor/.../Component/Console', ['Tests/*', '!*.php']);
$compiler->compile("$outputDir/mycoolprogram.phar");
```
Installation
------------
### Install via Composer
[Install Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos) if you don't already have it present on your system.
To install the library, run the following command and you will get the latest version:
$ composer require secondtruth/phar-compiler
Requirements
------------
* You must have at least PHP version 5.6 installed on your system.