Block8/PHPCI — pull request #48 by kamermans (2013-05-19 06:05:17+00:00)
Title: Implemented environment plugin

This pull does two things. First, it sets some PHPCI environment variables in the execution environment:

PHPCI=1
PHPCI_COMMIT=52e9aba3fae11c3b1db11f4d36b72c2862ea3cf0
PHPCI_PROJECT=3
PHPCI_BUILD=61
PHPCI_PROJECT_TITLE=MyApp
PHPCI_BUILD_PATH=/opt/PHPCI/build/project3-build61/

`PHPCI=1` is present to allow scripts to use simple logic like isset($_ENV['PHPCI']) to detect if they are running in PHPCI. The others give helpful information that may be used downstream.

The second part is the addition of the `Env` plugin, which allows you to set environment vars from the phpci.yml with any of these methods:

setup:
env:
- "FOO=BAR"
- FOO=BAR
- FOO: BAR

Travis-CI supports setting vars like "env: FOO=BAR", but I think that will break the Plugin interface since the `$options` would then be a string instead of an array.

Note that these env vars are available in the environment that commands are exec()'s in inside the Builder class, but they may not be available elsewhere. I am using them from a PHPUnit test, and they work fine there.