php-band

A simple bash tool to compile php versions

Installation

Just clone the repository

git clone git@github.com:francisek/php-band

Requirements

To compile a PHP version, you will need:

Using php-band

Run

bin/php-band --help

to get help on how to run this tool.

Running tests

The test suite uses the bats framework. Install it from repository:

git clone --depth 1 git@github.com:sstephenson/bats.git

Then run the tests :

./bats/bin/bats tests

if you want also to fully compile php while testing, you have to set the environment variable PHP_BAND_TEST_COMPILATION.

The compilation process

What does php-band is :

Custom configuration

How it works

You can define custom configuration to plot any version. The version-independant configurations reside in the config directory. The you can plot a specific version configuration in a version-like subtree of the config directory. To get it clear, look at this example of config tree:

./config
  + configure-php.sh
  + 5/
    + configure-php.sh
    + 6/
      + configure-php.sh

php-band will use first ./config/configure-php.sh for any version. Then if major version is 5, ./config/5/configure-php.sh overrides the previous configuration. Then if major version is 5 and minor version is 6, .config/5/6/configure-php.sh overrides the previous configuration. And so on ...

What you can do

Each version-matching configure-php.sh file is sourced into php-band with the version components as arguments (major, minor, patch and addon). You can define some variables and functions to customize the version you are installing.

Alterable variables and functions

Readonly variables

Those variables can be used but should not be modified:

Usefull functions

Some core functions may be usefull in your functions :

Best practises in writing configuration files

The configuration file