phpci/PHPCI/Plugin/Composer.php

22 lines
562 B
PHP
Raw Normal View History

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;
$this->directory = isset($options['directory']) ? $options['directory'] : $phpci->buildPath;
$this->action = isset($options['action']) ? $options['action'] : 'update';
}
public function execute()
{
return $this->phpci->executeCommand('composer --working-dir=' . $this->directory . ' ' . $this->action);
}
}