This commit is contained in:
Martin 2016-09-17 06:11:03 +00:00 committed by GitHub
commit 3df08c937c

View file

@ -28,6 +28,7 @@ class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
protected $phpci;
protected $build;
protected $nodev;
protected $ignorePlatformReqs;
/**
* Check if this plugin can be executed.
@ -63,6 +64,7 @@ class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
$this->preferDist = false;
$this->preferSource = false;
$this->nodev = false;
$this->ignorePlatformReqs = false;
if (array_key_exists('directory', $options)) {
$this->directory = $path . DIRECTORY_SEPARATOR . $options['directory'];
@ -84,6 +86,10 @@ class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
if (array_key_exists('no_dev', $options)) {
$this->nodev = (bool)$options['no_dev'];
}
if (array_key_exists('ignore_platform_reqs', $options)) {
$this->ignorePlatformReqs = (bool)$options['ignore_platform_reqs'];
}
}
/**
@ -116,6 +122,11 @@ class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
$cmd .= ' --no-dev';
}
if ($this->ignorePlatformReqs) {
$this->phpci->log('Using --ignore-platform-reqs flag');
$cmd .= ' --ignore-platform-reqs';
}
$cmd .= ' --working-dir="%s" %s';
return $this->phpci->executeCommand($cmd, $this->directory, $this->action);