README

A few simple tools to manage configuration data sanely. These tools are to hold environment data that can be shared without risk. They are not designed to hold 'secrets' e.g. api/oauth keys.

Config file generator

Environment settings generator

Convert PHP ini files to PHP-FPM format

Philosophy

Environment variables need to be granular controls. Although they can be grouped together as "environments", they need to be configurable on a per-deploy basis without duplicating large blocks of information.

They also need to be stored alongside the application's code so that they can be maintained easily.

This library allows you to do these two things. All environment settings can be stored in a simple way, and then extracted and combined with arbitrary combinations. E.g. using 'centos,dev' as the environment setting uses all the 'centos' environment settings, with the 'dev' settings over-riding any duplicate settings.

Example usage for people who don't like reading instructions

If you install Configurator through Composer, the executable files will be in the vendor/bin directory and can be run with:

Syntax

A comma separated list of PHP data files. Each need to return an array of data.

-j

A comma separated list of JSON data files.

-y

A comma separated list of YAML files.

input

The input template file.

output

The output file to write.

environment

A comma separated list of environment settings to apply.

Generate environment settings

A tool that will parse the environment settings required by an application and the data files that hold the settings for all environments, and generate a file that contains a function which returns an array of what env settings are required by this application.

Given this file listing the environment settings required by an application:

Syntax

A comma separated list of PHP data files. Each need to return an array of data.

-j

A comma separated list of JSON data files.

-y

A comma separated list of YAML files.

input

The input template file.

output

The output file to write.

environment

A comma separated list of environment settings to apply.

Convert PHP ini files to PHP-FPM format

Because of reasons, PHP-FPM doesn't use the standard PHP in file format when including ini files in a pool in the PHP-FPM conf file. This aspect of the Configurator converts PHP style ini files to the format PHP-FPM expects: