2017 © Pedro Peláez
 

library satisgen

Generates a Satis satis.json file from a satis.php file

image

markchalloner/satisgen

Generates a Satis satis.json file from a satis.php file

  • Wednesday, April 27, 2016
  • by markchalloner
  • Repository
  • 1 Watchers
  • 1 Stars
  • 35 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

SatisGen

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads, (*1)

Introduction

A config file generator. Allows you to seperate your configuration file and sensitive data into environment variables. Originally used to generate satis.json file from a satis.php file, but can be used as a pre-parser for any text based config files even those without a php specific file extension., (*2)

When run, will check for each environmental variables specified in the file and if found replace in the final output file or prompt the user to enter the data., (*3)

If the environmental variables are not found a Dotenv file is written at .env with the values from the user., (*4)

Installation

Via Composer, (*5)

``` bash $ composer require 'markchalloner/satisgen:~1.0', (*6)


## Usage Create a satis.php file. Within this file use the function: ``` php $config->getConfig($name, $description, $default = null, $validator = null, $secure = false);

For example, (*7)

``` php $config->getConfig('LICENCE', 'your licence key', null, function($answer) { if (16 !== strlen($answer)) { throw new \RuntimeException( 'The licence should be 16 characters long' ); } if (1 === preg_match('/[^a-f0-9]/i', $answer)) { throw new \RuntimeException( 'The licence should include hexadecimal characters only' ); } return $answer; }, true);, (*8)


Run ``` bash vendor/bin/satisgen [input_file (default:satis.php)] [output_file (default:satis.json)]

Examples

Satis json

An example satis.php file can be found under, (*9)

tests/fixtures/satis.php

Run, (*10)

``` bash vendor/bin/satisgen vendor/markchalloner/satisgen/tests/fixtures/satis.php, (*11)


Generates a satis.json file in the project directory. #### htaccess See [Oban-Satis] for an example [.htaccess.php] file. Run ``` bash vendor/bin/satisgen .htaccess.php .htaccess

Generates a .htaccess file in the project directory., (*12)

Change log

Please see CHANGELOG for more information what has changed recently., (*13)

Testing

bash $ composer test, (*14)

Security

If you discover any security related issues, please email mark.a.r.challoner@gmail.com instead of using the issue tracker., (*15)

Notes

Built as a learning exercise with:, (*16)

to pull together other techniques:, (*17)

to keep a record of archived tools and techniques:, (*18)

and to implement (todo):, (*19)

The Versions

27/04 2016

dev-master

9999999-dev

Generates a Satis satis.json file from a satis.php file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mark Challoner

08/06 2015

1.0.1

1.0.1.0

Generates a Satis satis.json file from a satis.php file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mark Challoner

07/06 2015

1.0.0

1.0.0.0

Generates a Satis satis.json file from a satis.php file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mark Challoner

09/05 2015

0.0.3

0.0.3.0

Generates a Satis satis.json file from a satis.php file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mark Challoner

09/05 2015

0.0.2

0.0.2.0

Generates a Satis satis.json file from a satis.php file

  Sources   Download

The Requires

 

The Development Requires

by Mark Challoner

09/05 2015

0.0.1

0.0.1.0

Generates a Satis satis.json file from a satis.php file

  Sources   Download

The Requires

 

The Development Requires

by Mark Challoner