2017 © Pedro Pelรกez
 

library phar-builder

CLI tool for create phar of your composer based project

image

macfja/phar-builder

CLI tool for create phar of your composer based project

  • Sunday, May 27, 2018
  • by MacFJA
  • Repository
  • 8 Watchers
  • 93 Stars
  • 2,786 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 15 Forks
  • 6 Open issues
  • 19 Versions
  • 12 % Grown

The README.md

PharBuilder

Create a Phar (PHp ARchive) file of your Composer based PHP application, (*1)

Installation

Composer

composer require macfja/phar-builder

Phar archive

You can download the Phar directly on GitHub in the release section (https://github.com/MacFJA/PharBuilder), (*2)

Usage

Within a composer based project

vendor/bin/phar-builder package composer.json

With the phar

phar-builder.phar package path-to-your-composer.json-file

Options

They are 2 commands available:, (*3)

  • build a full interactive phar builder
  • package a phar builder based on a composer.json

Command package

Extract from the vendor/bin/phar-builder help package command, (*4)

Usage:
  package [options] [--] [<composer>]

Arguments:
  composer                       The path to the composer.json. If the argument is not provided, it will look for a composer.json file in the current directory

Options:
      --include-dev              Include development packages and path
  -e, --entry-point=ENTRY-POINT  Your application start file
      --compression=COMPRESSION  The compression of your Phar (possible values No, GZip, BZip2)
  -f, --no-compression           Do not compress the Phar
  -z, --gzip                     Set the compression of the Phar to GZip
  -b, --bzip2                    Set the compression of the Phar to BZip2
      --name=NAME                The filename of the Phar archive
  -o, --output-dir=OUTPUT-DIR    The output directory of the Phar archive
  -i, --include=INCLUDE          List of directories to add in Phar (multiple values allowed)
  -h, --help                     Display this help message
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi                     Force ANSI output
      --no-ansi                  Disable ANSI output
  -n, --no-interaction           Do not ask any interactive question
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
 Create a Phar file of a composer project.
 The command can get values from CLI argument, by reading composer file or by ask (in this order)
 If an option is both defined in the composer file and in the CLI argument, the CLI argument will be used.
 Example of a composer configuration:

   โ”Œ
   โ”‚  ... The content of your composer.json file
   โ”‚  "extra": {
   โ”‚      "phar-builder": {
   โ”‚          "compression": "GZip",
   โ”‚          "name": "application.phar",
   โ”‚          "output-dir": "../",
   โ”‚          "entry-point": "./index.php",
   โ”‚          "include": ["bin","js","css"],
   โ”‚          "include-dev": false,
   โ”‚          "events": {
   โ”‚              "command.build.start" : "git describe --tags > bin/version.txt",
   โ”‚              "command.build.end": [
   โ”‚                  "rm bin/version.txt",
   โ”‚                  "chmod +x ../application.phar"
   โ”‚              ]
   โ”‚          }
   โ”‚      }
   โ”‚  }
   โ””

More information about the Composer configuration, (*5)

Command build

The command build doesn't take any argument. All options will be ask through the CLI, (*6)

Important

  • The only way to add none source code and none vendors files is to use include option of the package command.
  • The only way to trigger script on build is to use composer.json configuration with package command.

Similar projects

  • https://github.com/clue/phar-composer
  • https://github.com/box-project/box2
  • https://github.com/IcecaveStudios/near
  • https://github.com/Modularr/Phar
  • https://github.com/kos33rd/pharaon
  • https://github.com/brad-jones/pharbuilder
  • https://github.com/index0h/yii2-phar
  • https://github.com/keradus/PharBuilder
  • https://github.com/JeroenDeDauw/PharBuilder
  • https://github.com/theseer/Autoload
  • https://github.com/crodas/Phar-Builder
  • https://github.com/oleics/php-ac-build-phar
  • https://github.com/mvccore/packager
  • https://github.com/box-project/box2-lib
  • https://github.com/humbug/box

License

The MIT License (MIT). Please see License File for more information., (*7)

The Versions

02/05 2018

dev-multiple-directory-separator+issue-49

dev-multiple-directory-separator+issue-49

CLI tool for create phar of your composer based project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar MacFJA

22/02 2018
25/03 2016
20/03 2016

0.2.3

0.2.3.0

CLI tool for create phar of your composer based project

  Sources   Download

MIT

The Requires

 

by Avatar MacFJA

20/03 2016

0.2.2

0.2.2.0

CLI tool for create phar of your composer based project

  Sources   Download

MIT

The Requires

 

by Avatar MacFJA

11/03 2016

0.2.1

0.2.1.0

CLI tool for create phar of your composer based project

  Sources   Download

MIT

The Requires

 

by Avatar MacFJA

02/10 2015

0.2

0.2.0.0

CLI tool for create phar of your composer based project

  Sources   Download

MIT

The Requires

 

by Avatar MacFJA

23/09 2015

0.1

0.1.0.0

CLI tool for create phar of your composer based project

  Sources   Download

MIT

The Requires

 

by Avatar MacFJA