Enabling the exception / error handler for console mode only. Also fixing a catchable fatal error in the BuildFactory class.

This commit is contained in:
Dan Cryer 2014-05-09 11:47:42 +01:00
parent 83a74952ee
commit f84e31b644
2 changed files with 9 additions and 2 deletions

View file

@ -21,11 +21,16 @@ class BuildFactory
/**
* @param $buildId
* @return Build
* @throws \Exception
*/
public static function getBuildById($buildId)
{
$build = Factory::getStore('Build')->getById($buildId);
if (empty($build)) {
throw new \Exception('Build ID ' . $buildId . ' does not exist.');
}
return self::getBuild($build);
}

View file

@ -59,8 +59,10 @@ if (!file_exists(dirname(__FILE__) . '/vendor/autoload.php') && defined('PHPCI_I
// Load Composer autoloader:
require_once(dirname(__FILE__) . '/vendor/autoload.php');
$loggerConfig = LoggerConfig::newFromFile(__DIR__ . "/loggerconfig.php");
Handler::register($loggerConfig->getFor('_'));
if (defined('PHPCI_IS_CONSOLE') && PHPCI_IS_CONSOLE) {
$loggerConfig = LoggerConfig::newFromFile(__DIR__ . "/loggerconfig.php");
Handler::register($loggerConfig->getFor('_'));
}
// Load configuration if present:
$conf = array();