diff --git a/PHPCI/Plugin/Composer.php b/PHPCI/Plugin/Composer.php index bd5f6658..f0edc605 100644 --- a/PHPCI/Plugin/Composer.php +++ b/PHPCI/Plugin/Composer.php @@ -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. @@ -62,6 +63,7 @@ class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin $this->action = 'install'; $this->preferDist = false; $this->nodev = false; + $this->ignorePlatformReqs = false; if (array_key_exists('directory', $options)) { $this->directory = $path . DIRECTORY_SEPARATOR . $options['directory']; @@ -78,6 +80,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']; + } } /** @@ -108,6 +114,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);