2014-03-08 19:44:54 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* PHPCI - Continuous Integration for PHP
|
|
|
|
*
|
|
|
|
* @copyright Copyright 2013, Block 8 Limited.
|
|
|
|
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
|
|
|
* @link http://www.phptesting.org/
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Let PHP take a guess as to the default timezone, if the user hasn't set one:
|
|
|
|
date_default_timezone_set(@date_default_timezone_get());
|
|
|
|
|
|
|
|
// Load Composer autoloader:
|
|
|
|
require_once(dirname(__DIR__) . '/vendor/autoload.php');
|
|
|
|
|
|
|
|
// Load configuration if present:
|
|
|
|
$conf = array();
|
|
|
|
$conf['b8']['app']['namespace'] = 'PHPCI';
|
|
|
|
$conf['b8']['app']['default_controller'] = 'Home';
|
|
|
|
$conf['b8']['view']['path'] = dirname(__DIR__) . '/PHPCI/View/';
|
|
|
|
|
2014-12-08 16:09:57 +01:00
|
|
|
// If the PHPCI config file is not where we expect it, try looking in
|
|
|
|
// env for an alternative config path.
|
|
|
|
$configFile = dirname(__FILE__) . '/PHPCI/config.yml';
|
|
|
|
|
|
|
|
if (!file_exists($configFile)) {
|
|
|
|
$configEnv = getenv('phpci_config_file');
|
|
|
|
|
|
|
|
if (!empty($configEnv)) {
|
|
|
|
$configFile = $configEnv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-24 14:57:37 +01:00
|
|
|
$config = new b8\Config($conf);
|
|
|
|
|
2014-12-08 16:09:57 +01:00
|
|
|
if (file_exists($configFile)) {
|
|
|
|
$config->loadYaml($configFile);
|
2014-03-08 19:44:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
require_once(dirname(__DIR__) . '/vars.php');
|
2014-12-08 16:04:44 +01:00
|
|
|
|
|
|
|
\PHPCI\Helper\Lang::init($config);
|