Generates config files from PHP based config files and PHP and JSON data files.

Installs: 253

Dependents: 1

Stars: 3

Watchers: 1

Open Issues: 1

0.3.0 2015-10-10 18:26 UTC


Generates config files from PHP based templates and PHP style config files.

Generate config files

Source config file

    access_log  ${''}/project.access.log requestTime;    
    error_log  ${''}/project.error.log;
    root ${''}/public;

Settings file:


$centos = [
    '' => '/var/log/nginx', 
    '' => '/home/project',

$windows = [
    '' => 'c:/nginx', 
    '' => 'c:/documents/project',

$dave = [
    '' => '/home/workdir/project',

configurate data/nginx.conf.php var/generated/nginx.conf centos,dave -p settings.php

    access_log  /var/log/nginx/project.access.log requestTime;    
    error_log  /var/log/nginx/project.error.log;
    root /home/workdir/project/public;

Generate environment settings

A file that returns an array of what env settings are required by this application


use ImagickDemo\Config;

$env = [

return $env;

Produces a file containing a single function that contains all the requested env settings.


function getAppEnv() {
    static $env = [
        'caching.setting' => 'caching.revalidate',
        'script.packing' => '',

    return $env;

The keys are the actual strings, rather than the constants used in the application, to allow the settings to be used outside of the application.

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:
default_charset = "utf-8";
post_max_size = 10M

to PHP-FPM style files:

php_admin_value[extension] = ""
php_admin_value[default_charset] = "utf-8"
php_admin_value[post_max_size] = "10M"