Fixing some formatting issues

This commit is contained in:
meadsteve 2013-10-26 16:25:34 +01:00
parent 8c88581021
commit b943c07f87
3 changed files with 153 additions and 139 deletions

View file

@ -293,9 +293,11 @@ class Builder implements LoggerAwareInterface
$this->interpolation_vars['%COMMIT%'] = $this->build->getCommitId();
$this->interpolation_vars['%PROJECT%'] = $this->build->getProjectId();
$this->interpolation_vars['%BUILD%'] = $this->build->getId();
$this->interpolation_vars['%PROJECT_TITLE%'] = $this->getBuildProjectTitle();
$this->interpolation_vars['%PROJECT_TITLE%'] = $this->getBuildProjectTitle(
);
$this->interpolation_vars['%BUILD_PATH%'] = $this->buildPath;
$this->interpolation_vars['%BUILD_URI%'] = PHPCI_URL . "build/view/" . $this->build->getId();
$this->interpolation_vars['%BUILD_URI%'] = PHPCI_URL . "build/view/" . $this->build->getId(
);
$this->interpolation_vars['%PHPCI_COMMIT%'] = $this->interpolation_vars['%COMMIT%'];
$this->interpolation_vars['%PHPCI_PROJECT%'] = $this->interpolation_vars['%PROJECT%'];
$this->interpolation_vars['%PHPCI_BUILD%'] = $this->interpolation_vars['%BUILD%'];
@ -307,7 +309,9 @@ class Builder implements LoggerAwareInterface
putenv('PHPCI_COMMIT=' . $this->interpolation_vars['%COMMIT%']);
putenv('PHPCI_PROJECT=' . $this->interpolation_vars['%PROJECT%']);
putenv('PHPCI_BUILD=' . $this->interpolation_vars['%BUILD%']);
putenv('PHPCI_PROJECT_TITLE='.$this->interpolation_vars['%PROJECT_TITLE%']);
putenv(
'PHPCI_PROJECT_TITLE=' . $this->interpolation_vars['%PROJECT_TITLE%']
);
putenv('PHPCI_BUILD_PATH=' . $this->interpolation_vars['%BUILD_PATH%']);
putenv('PHPCI_BUILD_URI=' . $this->interpolation_vars['%BUILD_URI%']);
}
@ -317,7 +321,8 @@ class Builder implements LoggerAwareInterface
*/
protected function setupBuild()
{
$buildId = 'project' . $this->build->getProject()->getId() . '-build' . $this->build->getId();
$buildId = 'project' . $this->build->getProject()->getId(
) . '-build' . $this->build->getId();
$this->ciDir = dirname(__FILE__) . '/../';
$this->buildPath = $this->ciDir . 'build/' . $buildId . '/';
@ -348,7 +353,11 @@ class Builder implements LoggerAwareInterface
protected function executePlugins($stage)
{
// Ignore any stages for which we don't have plugins set:
if (!array_key_exists($stage, $this->config) || !is_array($this->config[$stage])) {
if (!array_key_exists(
$stage,
$this->config
) || !is_array($this->config[$stage])
) {
return;
}
@ -450,7 +459,8 @@ class Builder implements LoggerAwareInterface
* @param LoggerInterface $logger
* @return null
*/
public function setLogger(LoggerInterface $logger) {
public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
}
@ -459,7 +469,8 @@ class Builder implements LoggerAwareInterface
*
* @return LoggerInterface
*/
public function getLogger() {
public function getLogger()
{
return $this->logger;
}
}

View file

@ -16,17 +16,19 @@ class BuildDBLogHandler extends AbstractProcessingHandler
protected $logValue;
function __construct(Build $build,
function __construct(
Build $build,
$level = LogLevel::INFO,
$bubble = true)
{
$bubble = true
) {
parent::__construct($level, $bubble);
$this->build = $build;
// We want to add to any existing saved log information.
$this->logValue = $build->getLog();
}
protected function write(array $record) {
protected function write(array $record)
{
$this->logValue .= (string)$record['formatted'];
$this->build->setLog($this->logValue);
}

View file

@ -14,10 +14,11 @@ class OutputLogHandler extends AbstractProcessingHandler
*/
protected $output;
function __construct(OutputInterface $output,
function __construct(
OutputInterface $output,
$level = LogLevel::INFO,
$bubble = true)
{
$bubble = true
) {
parent::__construct($level, $bubble);
$this->output = $output;
}