Skip to content

Commit 4d1e502

Browse files
committed
More words in the readme.
1 parent 0cef2fc commit 4d1e502

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

README.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,37 @@ A few simple tools to manage configuration data sanely. These tools are to hold
55

66
* Config file generator
77

8-
* Environment settings
8+
* Environment settings generator
99

1010
* Convert PHP ini files to PHP-FPM format
1111

12-
## Config file generator
12+
Philosophy
13+
----------
14+
15+
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.
16+
17+
They also need to be stored stored alongside the applications code so that they can be maintained easily.
18+
19+
This library allows you to do these two thing. 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.
20+
21+
22+
Example usage for people who don't like reading instructions
23+
------------------------------------------------------------
24+
25+
```
26+
#Generate nginx config file for the centos,dev environment
27+
bin/configurate -p example/config.php example/config_template/nginx.conf.php autogen/nginx.conf "centos,dev"
28+
29+
# Generate a PHP file that contains a function that return the current application env settings
30+
bin/genenv -p example/config.php example/envRequired.php autogen/appEnv.php "centos,dev"
31+
32+
# Convert a PHP ini file to be in the PHP-FPM format
33+
bin/fpmconv autogen/php.ini autogen/php.fpm.ini
34+
```
35+
36+
37+
Config file generator
38+
---------------------
1339

1440
This tool allows you to generate config files from PHP based templates and PHP data files that hold all of the setting for the different environments
1541

@@ -48,13 +74,13 @@ $windows = [
4874
'project.root.directory' => 'c:/documents/project',
4975
];
5076
51-
$dave = [
77+
$john = [
5278
'project.root.directory' => '/home/workdir/project',
5379
]
5480
5581
```
5682

57-
Running the command `configurate data/nginx.conf.php var/generated/nginx.conf centos,dave -p settings.php` would generated the file:
83+
Running the command `configurate data/nginx.conf.php var/generated/nginx.conf centos,john -p settings.php` would generated the file:
5884

5985

6086
```
@@ -76,7 +102,8 @@ environment - a comma separated list of environment settings to apply.
76102

77103

78104

79-
## Generate environment settings
105+
Generate environment settings
106+
-----------------------------
80107

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

@@ -147,7 +174,8 @@ input - the input template file.
147174
output - the output file to write.
148175
environment - a comma separated list of environment settings to apply.
149176

150-
## Convert PHP ini files to PHP-FPM format
177+
Convert PHP ini files to PHP-FPM format
178+
---------------------------------------
151179

152180
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:
153181

example.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ fi
1717
mkdir -p autogen
1818

1919

20+
21+
#Generate config templates for the set environment
2022
bin/configurate -p example/config.php example/config_template/nginx.conf.php autogen/nginx.conf $environment
2123
bin/configurate -p example/config.php example/config_template/php-fpm.conf.php autogen/php-fpm.conf $environment
2224
bin/configurate -p example/config.php example/config_template/php.ini.php autogen/php.ini $environment

0 commit comments

Comments
 (0)