2017 © Pedro Peláez
 

library environaut

Define, configure and protect your application environment and its requirements.

image

graste/environaut

Define, configure and protect your application environment and its requirements.

  • Monday, August 31, 2015
  • by graste
  • Repository
  • 5 Watchers
  • 14 Stars
  • 612 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 6 Open issues
  • 15 Versions
  • 0 % Grown

The README.md

Environaut

  • Latest Version: Latest Stable Version
  • Build: Build Status

Please have a look at the available releases., (*1)

Purpose

Environaut should enable and help developers to define the environment of an application and check if all defined constraints are met. This includes assertions and requirements of the application environment as well as some configuration that may be necessary to make an application run. See the docs/ folder or the wiki for more information., (*2)

When you plan to use Environaut to create settings files for your application please skip to the Requirements and installation section., (*3)

Quickstart for curious users

  1. Download the environaut.phar file of the release you prefer
  2. Make it executable via chmod u+x environaut.phar
  3. Run ./environaut.phar check
  4. Notice the error message for a missing configuration file
  5. Create a minimal config file (e.g. as xml or json) next to the environaut.phar file.
  6. Run ./environaut.phar check again (with --config ... if the file is not named environaut.(xml|json|php))
  7. Notice the output and created settings and cache file that is used when you run Environaut another time.

Short introduction for interested developers

Environaut parses a configuration file that contains defined environment checks. After that, each check is processed and the results of each check are compiled into a report. Each check can emit messages and settings. The messages will be printed to the shell and the settings can be exported in specified formats., (*4)

For a verbose example configuration file do this:, (*5)

  1. Clone this repository and change into that directory
  2. Run make install-dependencies-dev
  3. Run bin/environaut check

Notice the checks and questions and that there's an environaut-config.xml afterwards in your working directory. Change the sample environaut.xml to use environaut-config.json instead of the XML variant as the settings export formatter and re-run the checks to get your settings as JSON., (*6)

Requirements and installation

  • Non-Windows operating system (tested on Ubuntu 12.04/13.04 and MacOS X)
  • PHP v5.3+
  • libxml when XML configuration files are used

There are multiple ways to use and run environaut:, (*7)

  • download and use the PHAR file
  • install via Composer CLI
  • install via Composer (composer.json)

PHAR

The easiest way to use environaut is to download the environaut.phar of the latest stable release, make it executable and put a configuration file next to the php archive and then run ./environaut.phar check, (*8)

Composer CLI

Install Environaut via Composer:, (*9)

  1. Install Composer (if it's not already installed or available via PATH environment): curl -sS https://getcomposer.org/installer | php.
  2. Install Environaut: ./composer.phar require graste/environaut [optional version]
  3. Create a Environaut configuration file (see environaut.xml or examples)
  4. Run it: ./vendor/bin/environaut.phar check

Composer project vendor dependency

Another way to install Environaut is via composer as a vendor dependency of your project. Create or update a composer.json file and run the php composer.phar install command to get Environaut:, (*10)

{
    "require": {
        "graste/environaut": "~0.5"
    }
}

Alternatively, you can download the environaut.zip file and extract it. The bin/environaut.phar file is a standalone and self-executable binary., (*11)

$ environaut.phar --help

When you got environaut.phar by cloning this repository it should already be executable. Otherwise chmod u+x environaut.phar should be sufficient to make it work. It is advisable to have a php executable available via the PATH environment variable as the phar uses a #!/usr/bin/env php shebang. Use something like alias php="/usr/local/bin/php53" if your executable is not in the PATH. To get the Makefile working you can try a simple export PHP_PATH = "/usr/local/bin/php53" as that will be used instead of the default php for make., (*12)

Usage examples

You may combine multiple commandline options:, (*13)

environaut.phar help check
environaut.phar check --verbose --profile
environaut.phar check --config path/to/environaut.json
environaut.phar check --autoload-dir path/to/custom/files/src
environaut.phar check --no-cache

The check commandline options are:, (*14)

  • --autoload-dir="…" (-a): Folder for autoloading of custom .php classes.
  • --config="…" (-c): Path to configuration file with check definitions.
  • --config-handler="…": Namespaced classname of custom IConfigHandler (will be autoloaded from the autoload_dir).
  • --include-path="…" (-i): Path to prepend to PHP include_path.
  • --bootstrap="…" (-b): File to require before running the checks.
  • --no-cache: Don't read, write or use cache files (Disables caching).
  • --cache-location="…": Read and write cache from and to that file.

Other available and useful options are:, (*15)

  • --verbose (-v): Increase the verbosity of messages.
  • --version (-V):` Display Environaut version.
  • --ansi: Force ANSI output.
  • --no-ansi Disable ANSI output.
  • --profile Display timing and memory usage information.

For the help command the following works:, (*16)

  • --xml: To output help as XML.
  • --format: To output help in other formats.
  • --raw: To output raw command help.
  • --help (-h): Display the help message.

Documentation

Checks can be configured via configuration files and settings may afterwards be exported via different formatters into different formats., (*17)

Supported (input) configuration file formats:, (*18)

  • XML
  • JSON
  • PHP

Supported (output) settings file formats:, (*19)

  • XML (agavi xml config format; can be customized via template strings)
  • JSON (json object literal)
  • PHP (settings as array to include)
  • SH (shell variables in a file that may be sourced)
  • TEXT (settings with or without their group name in a plain text file)

The input and output file formats may be completely customized by replacing the default classes with custom implementations., (*20)

Community

None, but you may join the freenode IRC #honeybee channel anytime. :-), (*21)

Please contribute by forking and sending a pull request. More information can be found in the CONTRIBUTING.md file., (*22)

Contributors

See AUTHORS.md for a list of contributors., (*23)

Changelog

See CHANGELOG.md for more information about changes., (*24)

License

MIT license – see linked license for details., (*25)

  • Total Composer Downloads: Composer Downloads

The Versions

31/08 2015

dev-master

9999999-dev https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

MIT

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

31/08 2015

0.5.3

0.5.3.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

MIT

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

06/10 2014

0.5.2

0.5.2.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

27/03 2014

v0.5.1

0.5.1.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

26/03 2014

v0.5.0

0.5.0.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

20/02 2014

v0.4.3

0.4.3.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

12/02 2014

v0.4.2

0.4.2.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

14/10 2013

v0.4.1

0.4.1.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

27/09 2013

v0.4.0

0.4.0.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

16/09 2013

v0.3.0

0.3.0.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

12/09 2013

v0.2.2

0.2.2.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

22/08 2013

v0.2.1

0.2.1.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

05/08 2013

v0.2.0

0.2.0.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

The Development Requires

php configuration cli check environment web requirements configuration management

20/03 2013

0.1.1

0.1.1.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

php configuration cli check environment web requirements

17/03 2013

0.1

0.1.0.0 https://github.com/graste/environaut

Define, configure and protect your application environment and its requirements.

  Sources   Download

CC-BY-SA-3.0

The Requires

 

php configuration cli check environment web requirements