diff --git a/PHPCI/BuildFactory.php b/PHPCI/BuildFactory.php index 82ebc221..3f48eec0 100644 --- a/PHPCI/BuildFactory.php +++ b/PHPCI/BuildFactory.php @@ -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); } diff --git a/bootstrap.php b/bootstrap.php index 2a271503..3b951a43 100755 --- a/bootstrap.php +++ b/bootstrap.php @@ -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();