Fixing some formatting issues
This commit is contained in:
parent
8c88581021
commit
b943c07f87
|
@ -1,11 +1,11 @@
|
|||
<?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/
|
||||
*/
|
||||
* 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/
|
||||
*/
|
||||
|
||||
namespace PHPCI;
|
||||
|
||||
|
@ -17,9 +17,9 @@ use Psr\Log\LoggerInterface;
|
|||
use Psr\Log\LogLevel;
|
||||
|
||||
/**
|
||||
* PHPCI Build Runner
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
*/
|
||||
* PHPCI Build Runner
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
*/
|
||||
class Builder implements LoggerAwareInterface
|
||||
{
|
||||
/**
|
||||
|
@ -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%'];
|
||||
|
@ -304,12 +306,14 @@ class Builder implements LoggerAwareInterface
|
|||
$this->interpolation_vars['%PHPCI_BUILD_URI%'] = $this->interpolation_vars['%BUILD_URI%'];
|
||||
|
||||
putenv('PHPCI=1');
|
||||
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_BUILD_PATH='.$this->interpolation_vars['%BUILD_PATH%']);
|
||||
putenv('PHPCI_BUILD_URI='.$this->interpolation_vars['%BUILD_URI%']);
|
||||
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_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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,18 +16,20 @@ 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) {
|
||||
$this->logValue .= (string) $record['formatted'];
|
||||
protected function write(array $record)
|
||||
{
|
||||
$this->logValue .= (string)$record['formatted'];
|
||||
$this->build->setLog($this->logValue);
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
@ -25,7 +26,7 @@ class OutputLogHandler extends AbstractProcessingHandler
|
|||
|
||||
protected function write(array $record)
|
||||
{
|
||||
$this->output->writeln((string) $record['formatted']);
|
||||
$this->output->writeln((string)$record['formatted']);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue