From a137e9c0c6e05878468a9028bb8817a471ee3620 Mon Sep 17 00:00:00 2001 From: Alexander Pirogov Date: Thu, 18 Jul 2013 16:10:55 +0300 Subject: [PATCH] added prefer_dist option to composer plugin --- PHPCI/Plugin/Composer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PHPCI/Plugin/Composer.php b/PHPCI/Plugin/Composer.php index 42195f52..df2da277 100644 --- a/PHPCI/Plugin/Composer.php +++ b/PHPCI/Plugin/Composer.php @@ -19,6 +19,7 @@ class Composer implements \PHPCI\Plugin { protected $directory; protected $action; + protected $preferDist; protected $phpci; public function __construct(\PHPCI\Builder $phpci, array $options = array()) @@ -27,6 +28,7 @@ class Composer implements \PHPCI\Plugin $this->phpci = $phpci; $this->directory = isset($options['directory']) ? $path . '/' . $options['directory'] : $path; $this->action = isset($options['action']) ? $options['action'] : 'update'; + $this->preferDist = isset($options['prefer_dist']) ? $options['prefer_dist'] : true; } /** @@ -34,7 +36,7 @@ class Composer implements \PHPCI\Plugin */ public function execute() { - $cmd = PHPCI_DIR . 'composer.phar --prefer-dist --working-dir="%s" %s'; + $cmd = PHPCI_DIR . 'composer.phar '. ($this->preferDist ? '--prefer-dist' : null) .' --working-dir="%s" %s'; return $this->phpci->executeCommand($cmd, $this->directory, $this->action); } }