Updating PHPCI to use Composer-installed copies of the plugin requirements

This commit is contained in:
Dan Cryer 2013-05-10 15:00:24 +01:00
parent 2cd60e0524
commit 14f40e9b0f
8 changed files with 18 additions and 7 deletions

View file

@ -17,6 +17,6 @@ class Composer implements \PHPCI\Plugin
public function execute()
{
return $this->phpci->executeCommand('composer --working-dir=' . $this->directory . ' ' . $this->action);
return $this->phpci->executeCommand(PHPCI_DIR . 'composer.phar --working-dir=' . $this->directory . ' ' . $this->action);
}
}

View file

@ -17,9 +17,11 @@ class Mysql implements \PHPCI\Plugin
{
$rtn = true;
$db = \b8\Database::getConnection('write')->getDetails();
foreach($this->queries as $query)
{
$rtn = !$this->phpci->executeCommand('mysql -uroot -e "'.$query.'"') ? false : $rtn;
$rtn = !$this->phpci->executeCommand('mysql -h'.PHPCI_DB_HOST.' -u'.$db['user'].(!empty($db['pass']) ? ' -p' . $db['pass'] : '').' -e "'.$query.'"') ? false : $rtn;
}
return $rtn;

View file

@ -27,6 +27,6 @@ class PhpCodeSniffer implements \PHPCI\Plugin
$ignore = ' --ignore=' . implode(',', $ignore);
}
return $this->phpci->executeCommand('phpcs --standard=' . $this->standard . $ignore. ' ' . $this->phpci->buildPath);
return $this->phpci->executeCommand(PHPCI_BIN_DIR . 'phpcs --standard=' . $this->standard . $ignore. ' ' . $this->phpci->buildPath);
}
}

View file

@ -27,6 +27,6 @@ class PhpCpd implements \PHPCI\Plugin
$ignore = ' ' . implode('', $ignore);
}
return $this->phpci->executeCommand('phpcpd ' . $ignore . ' ' . $this->phpci->buildPath);
return $this->phpci->executeCommand(PHPCI_BIN_DIR . 'phpcpd ' . $ignore . ' ' . $this->phpci->buildPath);
}
}

View file

@ -23,6 +23,6 @@ class PhpMessDetector implements \PHPCI\Plugin
$ignore = ' --exclude ' . implode(',', $ignore);
}
return $this->phpci->executeCommand('phpmd ' . $this->phpci->buildPath . ' text codesize,unusedcode,naming' . $ignore);
return $this->phpci->executeCommand(PHPCI_BIN_DIR . 'phpmd ' . $this->phpci->buildPath . ' text codesize,unusedcode,naming' . $ignore);
}
}

View file

@ -17,6 +17,6 @@ class PhpUnit implements \PHPCI\Plugin
public function execute()
{
return $this->phpci->executeCommand('phpunit ' . $this->args . ' ' . $this->phpci->buildPath . $this->directory);
return $this->phpci->executeCommand(PHPCI_BIN_DIR . 'phpunit ' . $this->args . ' ' . $this->phpci->buildPath . $this->directory);
}
}

View file

@ -1,6 +1,7 @@
{
"name": "block8/phpci",
"description": "Simple continuous integration for PHP projects.",
"minimum-stability": "dev",
"authors": [
{
@ -10,6 +11,11 @@
],
"require": {
"block8/b8framework": "dev-master"
"block8/b8framework": "dev-master",
"phpunit/phpunit": "3.*",
"phpmd/phpmd" : "1.*",
"sebastian/phpcpd": "1.*",
"squizlabs/php_codesniffer": "1.*",
"ext-yaml": "*"
}
}

View file

@ -5,6 +5,9 @@ ini_set('display_errors', 'on');
require_once('bootstrap.php');
define('PHPCI_BIN_DIR', dirname(__FILE__) . '/vendor/bin/');
define('PHPCI_DIR', dirname(__FILE__) . '/');
$store = b8\Store\Factory::getStore('Build');
$result = $store->getByStatus(0);