Skip to content

Building Phar Application

Bertie2011 edited this page Aug 29, 2021 · 3 revisions

Build

Once you've done your command-line application with CLIFramework, you can simply build the executable phar file by just one command. Let's take assetkit for example:

php bin/assetkit --debug archive --app-bootstrap --executable --no-compress assetkit.phar

Then you can do:

mv assetkit.phar assetkit
chmod +x assetkit

How it works

CLIFramework uses its own composer config parser to parse your package dependencies. It reads the autoload option defined in your composer.json and other packages composer.json to generate a simple & fast class loader inside your app.

The --app-bootstrap option provides a generic cliframework app template, so you don't have to write your app bootstrap script.