2013-05-03 17:02:53 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace PHPCI\Plugin;
|
|
|
|
|
|
|
|
class Composer implements \PHPCI\Plugin
|
|
|
|
{
|
|
|
|
protected $directory;
|
|
|
|
protected $action;
|
|
|
|
protected $phpci;
|
|
|
|
|
|
|
|
public function __construct(\PHPCI\Builder $phpci, array $options = array())
|
|
|
|
{
|
|
|
|
$this->phpci = $phpci;
|
2013-05-10 13:28:43 +02:00
|
|
|
$this->directory = isset($options['directory']) ? $phpci->buildPath . '/' . $options['directory'] : $phpci->buildPath;
|
2013-05-03 17:02:53 +02:00
|
|
|
$this->action = isset($options['action']) ? $options['action'] : 'update';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function execute()
|
|
|
|
{
|
2013-05-16 01:17:57 +02:00
|
|
|
return $this->phpci->executeCommand(PHPCI_DIR . 'composer.phar --prefer-dist --working-dir="%s" %s', $this->directory, $this->action);
|
2013-05-03 17:02:53 +02:00
|
|
|
}
|
|
|
|
}
|