From a4e6134fdee12b10d9feaa7deccf10ff49b316db Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Mon, 8 Dec 2014 15:09:57 +0000 Subject: [PATCH] Fixing bootstrap --- Tests/bootstrap.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php index 6f8863c5..1d2f2ab4 100644 --- a/Tests/bootstrap.php +++ b/Tests/bootstrap.php @@ -19,9 +19,21 @@ $conf['b8']['app']['namespace'] = 'PHPCI'; $conf['b8']['app']['default_controller'] = 'Home'; $conf['b8']['view']['path'] = dirname(__DIR__) . '/PHPCI/View/'; -if (file_exists(dirname(__DIR__) . '/PHPCI/config.yml')) { +// 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; + } +} + +if (file_exists($configFile)) { $config = new b8\Config($conf); - $config->loadYaml(dirname(__DIR__) . '/PHPCI/config.yml'); + $config->loadYaml($configFile); } require_once(dirname(__DIR__) . '/vars.php');