PHPackages                             sevenpercent/phar-compiler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. sevenpercent/phar-compiler

ActiveLibrary[CLI &amp; Console](/categories/cli)

sevenpercent/phar-compiler
==========================

Compiles a CLI PHP project into a self-executing Phar archive

v1.0.0(8y ago)09CC0-1.0PHPPHP &gt;=7.2.0

Since Oct 19Pushed 8y agoCompare

[ Source](https://github.com/stevenhilder/PharCompiler)[ Packagist](https://packagist.org/packages/sevenpercent/phar-compiler)[ RSS](/packages/sevenpercent-phar-compiler/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

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

[](#pharcompiler)

Compiles a CLI PHP project into a self-executing Phar archive.

[![CC0](https://camo.githubusercontent.com/42a392c9ce97407913c025e81b79bb27bd1fc94e80bd88b73a6b2271219e13dc/687474703a2f2f692e6372656174697665636f6d6d6f6e732e6f72672f702f7a65726f2f312e302f38387833312e706e67)](http://creativecommons.org/publicdomain/zero/1.0/)

Usage
-----

[](#usage)

Assuming a project structure as follows...

```
$ pwd
/home/steven.hilder/foo
$ tree
├── bin
│   └── foo
├── src
│   ├── MyClass1.php
│   └── MyClass2.php
└── vendor
    ├── autoload.php
    └── composer
        └── ...

```

...where `bin/foo` is the executable entry point to your CLI application; you can compile the project by passing the executable, target build directory and array of include directories to `SevenPercent\PharCompiler::compile()`:

```
