From 9dcb29af5d2acf24093e14039a5ef9ae80c596fc Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Thu, 12 Nov 2015 14:41:39 +0000 Subject: [PATCH 01/32] Giving plugins an isAllowedInStage() method to protect them from being run at inappropriate times. Fixes #1122 Fixes #1090 --- PHPCI/Plugin.php | 1 + PHPCI/Plugin/AbstractPlugin.php | 31 +++++++++++++++++++++++++++++ PHPCI/Plugin/Atoum.php | 7 ++++++- PHPCI/Plugin/Behat.php | 7 ++++++- PHPCI/Plugin/Campfire.php | 7 ++++++- PHPCI/Plugin/CleanBuild.php | 2 +- PHPCI/Plugin/Codeception.php | 8 +++++++- PHPCI/Plugin/Composer.php | 3 ++- PHPCI/Plugin/CopyBuild.php | 2 +- PHPCI/Plugin/Deployer.php | 7 ++++++- PHPCI/Plugin/Email.php | 7 ++++++- PHPCI/Plugin/Env.php | 2 +- PHPCI/Plugin/FlowdockNotify.php | 7 ++++++- PHPCI/Plugin/Git.php | 2 +- PHPCI/Plugin/Grunt.php | 2 +- PHPCI/Plugin/Gulp.php | 2 +- PHPCI/Plugin/HipchatNotify.php | 7 ++++++- PHPCI/Plugin/Irc.php | 7 ++++++- PHPCI/Plugin/Lint.php | 7 ++++++- PHPCI/Plugin/Mysql.php | 2 +- PHPCI/Plugin/PackageBuild.php | 2 +- PHPCI/Plugin/Pdepend.php | 7 ++++++- PHPCI/Plugin/Pgsql.php | 2 +- PHPCI/Plugin/Phar.php | 2 +- PHPCI/Plugin/Phing.php | 2 +- PHPCI/Plugin/PhpCodeSniffer.php | 8 +++++++- PHPCI/Plugin/PhpCpd.php | 7 ++++++- PHPCI/Plugin/PhpCsFixer.php | 2 +- PHPCI/Plugin/PhpDocblockChecker.php | 8 +++++++- PHPCI/Plugin/PhpLoc.php | 3 ++- PHPCI/Plugin/PhpMessDetector.php | 8 +++++++- PHPCI/Plugin/PhpParallelLint.php | 7 ++++++- PHPCI/Plugin/PhpSpec.php | 7 ++++++- PHPCI/Plugin/PhpTalLint.php | 7 ++++++- PHPCI/Plugin/PhpUnit.php | 8 +++++++- PHPCI/Plugin/Shell.php | 2 +- PHPCI/Plugin/SlackNotify.php | 7 ++++++- PHPCI/Plugin/Sqlite.php | 2 +- PHPCI/Plugin/TechnicalDebt.php | 8 +++++++- PHPCI/Plugin/Util/Executor.php | 14 +++++++++++-- PHPCI/Plugin/Wipe.php | 2 +- PHPCI/Plugin/Xmpp.php | 2 +- 42 files changed, 196 insertions(+), 41 deletions(-) create mode 100644 PHPCI/Plugin/AbstractPlugin.php diff --git a/PHPCI/Plugin.php b/PHPCI/Plugin.php index ac2960cd..23a2bbda 100644 --- a/PHPCI/Plugin.php +++ b/PHPCI/Plugin.php @@ -15,5 +15,6 @@ namespace PHPCI; */ interface Plugin { + public function isAllowedInStage($stage); public function execute(); } diff --git a/PHPCI/Plugin/AbstractPlugin.php b/PHPCI/Plugin/AbstractPlugin.php new file mode 100644 index 00000000..c986e602 --- /dev/null +++ b/PHPCI/Plugin/AbstractPlugin.php @@ -0,0 +1,31 @@ +allowedStages); + } + + /** + * Execute the plugin and return its success or failure. + * @return bool + */ + abstract public function execute(); +} diff --git a/PHPCI/Plugin/Atoum.php b/PHPCI/Plugin/Atoum.php index 877f009b..52fcb019 100644 --- a/PHPCI/Plugin/Atoum.php +++ b/PHPCI/Plugin/Atoum.php @@ -17,8 +17,13 @@ use PHPCI\Model\Build; * Atoum plugin, runs Atoum tests within a project. * @package PHPCI\Plugin */ -class Atoum implements \PHPCI\Plugin +class Atoum extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + private $args; private $config; private $directory; diff --git a/PHPCI/Plugin/Behat.php b/PHPCI/Plugin/Behat.php index d63016dc..5ace7bf3 100644 --- a/PHPCI/Plugin/Behat.php +++ b/PHPCI/Plugin/Behat.php @@ -20,8 +20,13 @@ use PHPCI\Model\BuildError; * @package PHPCI * @subpackage Plugins */ -class Behat implements \PHPCI\Plugin +class Behat extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + protected $phpci; protected $build; protected $features; diff --git a/PHPCI/Plugin/Campfire.php b/PHPCI/Plugin/Campfire.php index 59ab9128..1829a8b3 100644 --- a/PHPCI/Plugin/Campfire.php +++ b/PHPCI/Plugin/Campfire.php @@ -20,8 +20,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Campfire implements \PHPCI\Plugin +class Campfire extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('complete', 'success', 'failure', 'fixed', 'broken'); + private $url; private $authToken; private $userAgent; diff --git a/PHPCI/Plugin/CleanBuild.php b/PHPCI/Plugin/CleanBuild.php index 684e8e7a..fa1f6790 100644 --- a/PHPCI/Plugin/CleanBuild.php +++ b/PHPCI/Plugin/CleanBuild.php @@ -19,7 +19,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class CleanBuild implements \PHPCI\Plugin +class CleanBuild extends AbstractPlugin { protected $remove; protected $phpci; diff --git a/PHPCI/Plugin/Codeception.php b/PHPCI/Plugin/Codeception.php index c28e3a48..f3eca9e5 100644 --- a/PHPCI/Plugin/Codeception.php +++ b/PHPCI/Plugin/Codeception.php @@ -14,6 +14,7 @@ use PHPCI\Helper\Lang; use PHPCI\Model\Build; use PHPCI\Plugin\Util\TestResultParsers\Codeception as Parser; use Psr\Log\LogLevel; +use PHPCI\ZeroConfigPlugin; /** * Codeception Plugin - Enables full acceptance, unit, and functional testing. @@ -23,8 +24,13 @@ use Psr\Log\LogLevel; * @package PHPCI * @subpackage Plugins */ -class Codeception implements \PHPCI\Plugin, \PHPCI\ZeroConfigPlugin +class Codeception extends AbstractPlugin implements ZeroConfigPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + /** @var string */ protected $args = ''; diff --git a/PHPCI/Plugin/Composer.php b/PHPCI/Plugin/Composer.php index bd5f6658..12938868 100644 --- a/PHPCI/Plugin/Composer.php +++ b/PHPCI/Plugin/Composer.php @@ -13,6 +13,7 @@ use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; use PHPCI\Helper\Lang; +use PHPCI\ZeroConfigPlugin; /** * Composer Plugin - Provides access to Composer functionality. @@ -20,7 +21,7 @@ use PHPCI\Helper\Lang; * @package PHPCI * @subpackage Plugins */ -class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin +class Composer extends AbstractPlugin implements ZeroConfigPlugin { protected $directory; protected $action; diff --git a/PHPCI/Plugin/CopyBuild.php b/PHPCI/Plugin/CopyBuild.php index f9646cac..b847b841 100644 --- a/PHPCI/Plugin/CopyBuild.php +++ b/PHPCI/Plugin/CopyBuild.php @@ -19,7 +19,7 @@ use PHPCI\Helper\Lang; * @package PHPCI * @subpackage Plugins */ -class CopyBuild implements \PHPCI\Plugin +class CopyBuild extends AbstractPlugin { protected $directory; protected $ignore; diff --git a/PHPCI/Plugin/Deployer.php b/PHPCI/Plugin/Deployer.php index 2db839e3..80ed06d7 100644 --- a/PHPCI/Plugin/Deployer.php +++ b/PHPCI/Plugin/Deployer.php @@ -19,8 +19,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Deployer implements \PHPCI\Plugin +class Deployer extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('complete', 'success', 'failure', 'fixed', 'broken'); + protected $webhookUrl; protected $reason; diff --git a/PHPCI/Plugin/Email.php b/PHPCI/Plugin/Email.php index 17e235e2..ef1fe7d5 100644 --- a/PHPCI/Plugin/Email.php +++ b/PHPCI/Plugin/Email.php @@ -23,8 +23,13 @@ use Psr\Log\LogLevel; * @package PHPCI * @subpackage Plugins */ -class Email implements \PHPCI\Plugin +class Email extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('complete', 'success', 'failure', 'fixed', 'broken'); + /** * @var \PHPCI\Builder */ diff --git a/PHPCI/Plugin/Env.php b/PHPCI/Plugin/Env.php index b89bf67d..a37446bd 100644 --- a/PHPCI/Plugin/Env.php +++ b/PHPCI/Plugin/Env.php @@ -19,7 +19,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Env implements \PHPCI\Plugin +class Env extends AbstractPlugin { protected $phpci; protected $build; diff --git a/PHPCI/Plugin/FlowdockNotify.php b/PHPCI/Plugin/FlowdockNotify.php index 8ac9f2ab..7f8b657c 100644 --- a/PHPCI/Plugin/FlowdockNotify.php +++ b/PHPCI/Plugin/FlowdockNotify.php @@ -19,8 +19,13 @@ use Mremi\Flowdock\Api\Push\TeamInboxMessage; * @package PHPCI * @subpackage Plugins */ -class FlowdockNotify implements \PHPCI\Plugin +class FlowdockNotify extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('complete', 'success', 'failure', 'fixed', 'broken'); + private $api_key; private $email; const MESSAGE_DEFAULT = 'Build %BUILD% has finished for commit %SHORT_COMMIT% diff --git a/PHPCI/Plugin/Git.php b/PHPCI/Plugin/Git.php index 60d6b551..7c146300 100644 --- a/PHPCI/Plugin/Git.php +++ b/PHPCI/Plugin/Git.php @@ -19,7 +19,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Git implements \PHPCI\Plugin +class Git extends AbstractPlugin { protected $phpci; protected $build; diff --git a/PHPCI/Plugin/Grunt.php b/PHPCI/Plugin/Grunt.php index 4d62ffd8..77715656 100644 --- a/PHPCI/Plugin/Grunt.php +++ b/PHPCI/Plugin/Grunt.php @@ -18,7 +18,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Grunt implements \PHPCI\Plugin +class Grunt extends AbstractPlugin { protected $directory; protected $task; diff --git a/PHPCI/Plugin/Gulp.php b/PHPCI/Plugin/Gulp.php index b6c6cab4..bbdbf7e0 100644 --- a/PHPCI/Plugin/Gulp.php +++ b/PHPCI/Plugin/Gulp.php @@ -18,7 +18,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Gulp implements \PHPCI\Plugin +class Gulp extends AbstractPlugin { protected $directory; protected $task; diff --git a/PHPCI/Plugin/HipchatNotify.php b/PHPCI/Plugin/HipchatNotify.php index a39b94fe..7af2f5f9 100644 --- a/PHPCI/Plugin/HipchatNotify.php +++ b/PHPCI/Plugin/HipchatNotify.php @@ -19,8 +19,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class HipchatNotify implements \PHPCI\Plugin +class HipchatNotify extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('complete', 'success', 'failure', 'fixed', 'broken'); + protected $authToken; protected $color; protected $notify; diff --git a/PHPCI/Plugin/Irc.php b/PHPCI/Plugin/Irc.php index a7610a8c..7ae5beef 100644 --- a/PHPCI/Plugin/Irc.php +++ b/PHPCI/Plugin/Irc.php @@ -19,8 +19,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Irc implements \PHPCI\Plugin +class Irc extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('complete', 'success', 'failure', 'fixed', 'broken'); + protected $phpci; protected $build; protected $message; diff --git a/PHPCI/Plugin/Lint.php b/PHPCI/Plugin/Lint.php index 1de49e41..2284ccfe 100644 --- a/PHPCI/Plugin/Lint.php +++ b/PHPCI/Plugin/Lint.php @@ -19,8 +19,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Lint implements PHPCI\Plugin +class Lint extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + protected $directories; protected $recursive = true; protected $ignore; diff --git a/PHPCI/Plugin/Mysql.php b/PHPCI/Plugin/Mysql.php index fdb521ef..5d4035cd 100644 --- a/PHPCI/Plugin/Mysql.php +++ b/PHPCI/Plugin/Mysql.php @@ -21,7 +21,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Mysql implements \PHPCI\Plugin +class Mysql extends AbstractPlugin { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/PackageBuild.php b/PHPCI/Plugin/PackageBuild.php index fb116640..04a52d99 100644 --- a/PHPCI/Plugin/PackageBuild.php +++ b/PHPCI/Plugin/PackageBuild.php @@ -18,7 +18,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class PackageBuild implements \PHPCI\Plugin +class PackageBuild extends AbstractPlugin { protected $directory; protected $filename; diff --git a/PHPCI/Plugin/Pdepend.php b/PHPCI/Plugin/Pdepend.php index faef406d..10b787ac 100644 --- a/PHPCI/Plugin/Pdepend.php +++ b/PHPCI/Plugin/Pdepend.php @@ -19,8 +19,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Pdepend implements \PHPCI\Plugin +class Pdepend extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + protected $args; /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/Pgsql.php b/PHPCI/Plugin/Pgsql.php index 60057464..5d6d18e4 100644 --- a/PHPCI/Plugin/Pgsql.php +++ b/PHPCI/Plugin/Pgsql.php @@ -19,7 +19,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Pgsql implements \PHPCI\Plugin +class Pgsql extends AbstractPlugin { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/Phar.php b/PHPCI/Plugin/Phar.php index c734bb6c..f3969829 100644 --- a/PHPCI/Plugin/Phar.php +++ b/PHPCI/Plugin/Phar.php @@ -10,7 +10,7 @@ use Phar as PHPPhar; /** * Phar Plugin */ -class Phar implements \PHPCI\Plugin +class Phar extends AbstractPlugin { /** * PHPCI diff --git a/PHPCI/Plugin/Phing.php b/PHPCI/Plugin/Phing.php index e322b72e..08ced3c3 100644 --- a/PHPCI/Plugin/Phing.php +++ b/PHPCI/Plugin/Phing.php @@ -20,7 +20,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Phing implements \PHPCI\Plugin +class Phing extends AbstractPlugin { private $directory; diff --git a/PHPCI/Plugin/PhpCodeSniffer.php b/PHPCI/Plugin/PhpCodeSniffer.php index 6f4ed4e0..8d072060 100644 --- a/PHPCI/Plugin/PhpCodeSniffer.php +++ b/PHPCI/Plugin/PhpCodeSniffer.php @@ -13,6 +13,7 @@ use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; use PHPCI\Model\BuildError; +use PHPCI\ZeroConfigPlugin; /** * PHP Code Sniffer Plugin - Allows PHP Code Sniffer testing. @@ -20,8 +21,13 @@ use PHPCI\Model\BuildError; * @package PHPCI * @subpackage Plugins */ -class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin +class PhpCodeSniffer extends AbstractPlugin implements ZeroConfigPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + /** * @var \PHPCI\Builder */ diff --git a/PHPCI/Plugin/PhpCpd.php b/PHPCI/Plugin/PhpCpd.php index 2424d41e..f074f0dc 100644 --- a/PHPCI/Plugin/PhpCpd.php +++ b/PHPCI/Plugin/PhpCpd.php @@ -20,8 +20,13 @@ use PHPCI\Model\BuildError; * @package PHPCI * @subpackage Plugins */ -class PhpCpd implements \PHPCI\Plugin +class PhpCpd extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + protected $directory; protected $args; protected $phpci; diff --git a/PHPCI/Plugin/PhpCsFixer.php b/PHPCI/Plugin/PhpCsFixer.php index 9aa0d33f..36033bf8 100644 --- a/PHPCI/Plugin/PhpCsFixer.php +++ b/PHPCI/Plugin/PhpCsFixer.php @@ -19,7 +19,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class PhpCsFixer implements \PHPCI\Plugin +class PhpCsFixer extends AbstractPlugin { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/PhpDocblockChecker.php b/PHPCI/Plugin/PhpDocblockChecker.php index 2396497c..7c20e013 100644 --- a/PHPCI/Plugin/PhpDocblockChecker.php +++ b/PHPCI/Plugin/PhpDocblockChecker.php @@ -12,6 +12,7 @@ namespace PHPCI\Plugin; use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\ZeroConfigPlugin; /** * PHP Docblock Checker Plugin - Checks your PHP files for appropriate uses of Docblocks @@ -19,8 +20,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class PhpDocblockChecker implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin +class PhpDocblockChecker extends AbstractPlugin implements ZeroConfigPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + /** * @var \PHPCI\Builder */ diff --git a/PHPCI/Plugin/PhpLoc.php b/PHPCI/Plugin/PhpLoc.php index c8dedb91..c67c88f9 100644 --- a/PHPCI/Plugin/PhpLoc.php +++ b/PHPCI/Plugin/PhpLoc.php @@ -12,6 +12,7 @@ namespace PHPCI\Plugin; use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\ZeroConfigPlugin; /** * PHP Loc - Allows PHP Copy / Lines of Code testing. @@ -19,7 +20,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class PhpLoc implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin +class PhpLoc extends AbstractPlugin implements ZeroConfigPlugin { /** * @var string diff --git a/PHPCI/Plugin/PhpMessDetector.php b/PHPCI/Plugin/PhpMessDetector.php index ec92bc61..11895f55 100644 --- a/PHPCI/Plugin/PhpMessDetector.php +++ b/PHPCI/Plugin/PhpMessDetector.php @@ -12,6 +12,7 @@ namespace PHPCI\Plugin; use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\ZeroConfigPlugin; /** * PHP Mess Detector Plugin - Allows PHP Mess Detector testing. @@ -19,8 +20,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class PhpMessDetector implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin +class PhpMessDetector extends AbstractPlugin implements ZeroConfigPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + /** * @var \PHPCI\Builder */ diff --git a/PHPCI/Plugin/PhpParallelLint.php b/PHPCI/Plugin/PhpParallelLint.php index febed528..ed319a48 100644 --- a/PHPCI/Plugin/PhpParallelLint.php +++ b/PHPCI/Plugin/PhpParallelLint.php @@ -19,8 +19,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class PhpParallelLint implements \PHPCI\Plugin +class PhpParallelLint extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + /** * @var \PHPCI\Builder */ diff --git a/PHPCI/Plugin/PhpSpec.php b/PHPCI/Plugin/PhpSpec.php index e468a718..4918dd4e 100644 --- a/PHPCI/Plugin/PhpSpec.php +++ b/PHPCI/Plugin/PhpSpec.php @@ -19,8 +19,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class PhpSpec implements PHPCI\Plugin +class PhpSpec extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + /** * @var \PHPCI\Builder */ diff --git a/PHPCI/Plugin/PhpTalLint.php b/PHPCI/Plugin/PhpTalLint.php index 8513ec36..960ccfba 100644 --- a/PHPCI/Plugin/PhpTalLint.php +++ b/PHPCI/Plugin/PhpTalLint.php @@ -19,8 +19,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class PhpTalLint implements PHPCI\Plugin +class PhpTalLint extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + protected $directories; protected $recursive = true; protected $suffixes; diff --git a/PHPCI/Plugin/PhpUnit.php b/PHPCI/Plugin/PhpUnit.php index f716f079..6923915c 100644 --- a/PHPCI/Plugin/PhpUnit.php +++ b/PHPCI/Plugin/PhpUnit.php @@ -13,6 +13,7 @@ use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; use PHPCI\Plugin\Util\TapParser; +use PHPCI\ZeroConfigPlugin; /** * PHP Unit Plugin - Allows PHP Unit testing. @@ -20,8 +21,13 @@ use PHPCI\Plugin\Util\TapParser; * @package PHPCI * @subpackage Plugins */ -class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin +class PhpUnit extends AbstractPlugin implements ZeroConfigPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + protected $args; protected $phpci; protected $build; diff --git a/PHPCI/Plugin/Shell.php b/PHPCI/Plugin/Shell.php index 5e914f3e..ca219ab6 100644 --- a/PHPCI/Plugin/Shell.php +++ b/PHPCI/Plugin/Shell.php @@ -19,7 +19,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Shell implements \PHPCI\Plugin +class Shell extends AbstractPlugin { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/SlackNotify.php b/PHPCI/Plugin/SlackNotify.php index 0e8d1cad..5b83d4fb 100644 --- a/PHPCI/Plugin/SlackNotify.php +++ b/PHPCI/Plugin/SlackNotify.php @@ -17,8 +17,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class SlackNotify implements \PHPCI\Plugin +class SlackNotify extends AbstractPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('complete', 'success', 'failure', 'fixed', 'broken'); + private $webHook; private $room; private $username; diff --git a/PHPCI/Plugin/Sqlite.php b/PHPCI/Plugin/Sqlite.php index f80ece3d..bd616eb0 100644 --- a/PHPCI/Plugin/Sqlite.php +++ b/PHPCI/Plugin/Sqlite.php @@ -19,7 +19,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Sqlite implements \PHPCI\Plugin +class Sqlite extends AbstractPlugin { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/TechnicalDebt.php b/PHPCI/Plugin/TechnicalDebt.php index 6d4711b5..e22d213e 100755 --- a/PHPCI/Plugin/TechnicalDebt.php +++ b/PHPCI/Plugin/TechnicalDebt.php @@ -12,6 +12,7 @@ namespace PHPCI\Plugin; use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\ZeroConfigPlugin; /** * Technical Debt Plugin - Checks for existence of "TODO", "FIXME", etc. @@ -20,8 +21,13 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class TechnicalDebt implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin +class TechnicalDebt extends AbstractPlugin implements ZeroConfigPlugin { + /** + * @inheritdoc + */ + protected $allowedStages = array('test'); + /** * @var \PHPCI\Builder */ diff --git a/PHPCI/Plugin/Util/Executor.php b/PHPCI/Plugin/Util/Executor.php index bdd06b7e..66c0e108 100644 --- a/PHPCI/Plugin/Util/Executor.php +++ b/PHPCI/Plugin/Util/Executor.php @@ -138,7 +138,7 @@ class Executor $this->setPluginStatus($stage, $plugin, Build::STATUS_RUNNING); // Try and execute it - if ($this->executePlugin($plugin, $options)) { + if ($this->executePlugin($plugin, $options, $stage)) { // Execution was successful $this->logger->logSuccess(Lang::get('plugin_success')); $this->setPluginStatus($stage, $plugin, Build::STATUS_SUCCESS); @@ -166,8 +166,12 @@ class Executor /** * Executes a given plugin, with options and returns the result. + * @param string $plugin Plugin name + * @param array $options Plugin options (from phpci.yml) + * @param string $stage Stage name + * @return bool */ - public function executePlugin($plugin, $options) + public function executePlugin($plugin, $options, $stage) { // Any plugin name without a namespace separator is a PHPCI built in plugin // if not we assume it's a fully name-spaced class name that implements the plugin interface. @@ -188,6 +192,12 @@ class Executor try { // Build and run it $obj = $this->pluginFactory->buildPlugin($class, $options); + + if (!$obj->isAllowedInStage($stage)) { + $this->logger->logFailure('Plugin "' . $plugin . '" cannot be run in stage: ' . $stage); + return false; + } + return $obj->execute(); } catch (\Exception $ex) { $this->logger->logFailure(Lang::get('exception') . $ex->getMessage(), $ex); diff --git a/PHPCI/Plugin/Wipe.php b/PHPCI/Plugin/Wipe.php index e6b619a0..aa3d4156 100644 --- a/PHPCI/Plugin/Wipe.php +++ b/PHPCI/Plugin/Wipe.php @@ -18,7 +18,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class Wipe implements \PHPCI\Plugin +class Wipe extends AbstractPlugin { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/Xmpp.php b/PHPCI/Plugin/Xmpp.php index ccfc4399..53d440f8 100644 --- a/PHPCI/Plugin/Xmpp.php +++ b/PHPCI/Plugin/Xmpp.php @@ -18,7 +18,7 @@ use PHPCI\Model\Build; * @package PHPCI * @subpackage Plugins */ -class XMPP implements \PHPCI\Plugin +class XMPP extends AbstractPlugin { protected $directory; protected $phpci; From 6a1b23bbb49604c02b88ed4c9727360b7f85bd67 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Thu, 12 Nov 2015 14:46:35 +0000 Subject: [PATCH 02/32] Adding docblock to cheer up PHPCI. --- PHPCI/Plugin/AbstractPlugin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PHPCI/Plugin/AbstractPlugin.php b/PHPCI/Plugin/AbstractPlugin.php index c986e602..fd78d00b 100644 --- a/PHPCI/Plugin/AbstractPlugin.php +++ b/PHPCI/Plugin/AbstractPlugin.php @@ -4,6 +4,10 @@ namespace PHPCI\Plugin; use PHPCI\Plugin; +/** + * Base for all of the standard PHPCI plugins. Provides the isAllowedInStage() functionality. + * @package PHPCI\Plugin + */ abstract class AbstractPlugin implements Plugin { /** From 29a6c9767ab0704e24a165c2344247a88e4122b2 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Thu, 12 Nov 2015 14:51:22 +0000 Subject: [PATCH 03/32] Fixing tests --- Tests/PHPCI/Plugin/Util/ExecutorTest.php | 12 ++++++------ Tests/PHPCI/Plugin/Util/Fake/ExamplePluginFull.php | 2 +- .../Util/Fake/ExamplePluginWithNoConstructorArgs.php | 2 +- .../Util/Fake/ExamplePluginWithSingleOptionalArg.php | 2 +- .../Util/Fake/ExamplePluginWithSingleRequiredArg.php | 2 +- .../Fake/ExamplePluginWithSingleTypedRequiredArg.php | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Tests/PHPCI/Plugin/Util/ExecutorTest.php b/Tests/PHPCI/Plugin/Util/ExecutorTest.php index e9083cec..3d0a3614 100644 --- a/Tests/PHPCI/Plugin/Util/ExecutorTest.php +++ b/Tests/PHPCI/Plugin/Util/ExecutorTest.php @@ -49,7 +49,7 @@ class ExecutorTest extends \PHPUnit_Framework_TestCase ->shouldBeCalledTimes(1) ->willReturn($this->prophesize('PHPCI\Plugin')->reveal()); - $this->testedExecutor->executePlugin($pluginName, $options); + $this->testedExecutor->executePlugin($pluginName, $options, 'test'); } public function testExecutePlugin_KeepsCalledNameSpace() @@ -61,7 +61,7 @@ class ExecutorTest extends \PHPUnit_Framework_TestCase ->shouldBeCalledTimes(1) ->willReturn($this->prophesize('PHPCI\Plugin')->reveal()); - $this->testedExecutor->executePlugin($pluginClass, $options); + $this->testedExecutor->executePlugin($pluginClass, $options, 'test'); } public function testExecutePlugin_CallsExecuteOnFactoryBuildPlugin() @@ -76,7 +76,7 @@ class ExecutorTest extends \PHPUnit_Framework_TestCase $this->mockFactory->buildPlugin(Argument::any(), Argument::any())->willReturn($mockPlugin->reveal()); $this->mockFactory->getResourceFor('PHPCI\Model\Build')->willReturn($build); - $this->testedExecutor->executePlugin($pluginName, $options); + $this->testedExecutor->executePlugin($pluginName, $options, 'test'); } public function testExecutePlugin_ReturnsPluginSuccess() @@ -91,7 +91,7 @@ class ExecutorTest extends \PHPUnit_Framework_TestCase $this->mockFactory->buildPlugin(Argument::any(), Argument::any())->willReturn($mockPlugin->reveal()); - $returnValue = $this->testedExecutor->executePlugin($pluginName, $options); + $returnValue = $this->testedExecutor->executePlugin($pluginName, $options, 'test'); $this->assertEquals($expectedReturnValue, $returnValue); } @@ -103,7 +103,7 @@ class ExecutorTest extends \PHPUnit_Framework_TestCase $this->mockBuildLogger->logFailure('Plugin does not exist: ' . $pluginName)->shouldBeCalledTimes(1); - $this->testedExecutor->executePlugin($pluginName, $options); + $this->testedExecutor->executePlugin($pluginName, $options, 'test'); } public function testExecutePlugin_LogsFailureWhenExceptionsAreThrownByPlugin() @@ -121,7 +121,7 @@ class ExecutorTest extends \PHPUnit_Framework_TestCase $this->mockBuildLogger->logFailure('Exception: ' . $expectedException->getMessage(), $expectedException) ->shouldBeCalledTimes(1); - $this->testedExecutor->executePlugin($pluginName, $options); + $this->testedExecutor->executePlugin($pluginName, $options, 'test'); } public function testExecutePlugins_CallsEachPluginForStage() diff --git a/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginFull.php b/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginFull.php index fa81a352..73ea98cc 100644 --- a/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginFull.php +++ b/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginFull.php @@ -14,7 +14,7 @@ use PHPCI\Builder; use PHPCI\Model\Build; use PHPCI\Plugin; -class ExamplePluginFull implements Plugin { +class ExamplePluginFull extends Plugin\AbstractPlugin { /** * @var array */ diff --git a/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithNoConstructorArgs.php b/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithNoConstructorArgs.php index 544ec4e3..efc27623 100644 --- a/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithNoConstructorArgs.php +++ b/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithNoConstructorArgs.php @@ -12,7 +12,7 @@ namespace Tests\PHPCI\Plugin\Util\Fake; use PHPCI\Plugin; -class ExamplePluginWithNoConstructorArgs implements Plugin +class ExamplePluginWithNoConstructorArgs extends Plugin\AbstractPlugin { public function execute() { diff --git a/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithSingleOptionalArg.php b/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithSingleOptionalArg.php index 9c78da6f..f9d636ed 100644 --- a/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithSingleOptionalArg.php +++ b/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithSingleOptionalArg.php @@ -12,7 +12,7 @@ namespace Tests\PHPCI\Plugin\Util\Fake; use PHPCI\Plugin; -class ExamplePluginWithSingleOptionalArg implements Plugin +class ExamplePluginWithSingleOptionalArg extends Plugin\AbstractPlugin { function __construct($optional = null) { diff --git a/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithSingleRequiredArg.php b/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithSingleRequiredArg.php index b623d7b1..411c4859 100644 --- a/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithSingleRequiredArg.php +++ b/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithSingleRequiredArg.php @@ -12,7 +12,7 @@ namespace Tests\PHPCI\Plugin\Util\Fake; use PHPCI\Plugin; -class ExamplePluginWithSingleRequiredArg implements Plugin +class ExamplePluginWithSingleRequiredArg extends Plugin\AbstractPlugin { public $RequiredArgument; diff --git a/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithSingleTypedRequiredArg.php b/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithSingleTypedRequiredArg.php index b256c58c..17e5a64c 100644 --- a/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithSingleTypedRequiredArg.php +++ b/Tests/PHPCI/Plugin/Util/Fake/ExamplePluginWithSingleTypedRequiredArg.php @@ -12,7 +12,7 @@ namespace Tests\PHPCI\Plugin\Util\Fake; use PHPCI\Plugin; -class ExamplePluginWithSingleTypedRequiredArg implements Plugin +class ExamplePluginWithSingleTypedRequiredArg extends Plugin\AbstractPlugin { public $RequiredArgument; From 148e4414fbbacdc60ceda84479f6c864a1f309c4 Mon Sep 17 00:00:00 2001 From: Stephen Ball Date: Thu, 12 Nov 2015 17:42:00 +0000 Subject: [PATCH 04/32] Fixes a issue with a double slash in the path meaning ignore doesn't work --- PHPCI/Plugin/Lint.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PHPCI/Plugin/Lint.php b/PHPCI/Plugin/Lint.php index 1de49e41..a7ddc55c 100644 --- a/PHPCI/Plugin/Lint.php +++ b/PHPCI/Plugin/Lint.php @@ -116,8 +116,7 @@ class Lint implements PHPCI\Plugin continue; } - $itemPath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; - $itemPath .= ltrim($item->getFilename(), DIRECTORY_SEPARATOR); + $itemPath = $path . $item->getFilename(); if (in_array($itemPath, $this->ignore)) { continue; From e437e9b855de48eec037c31d860297f58638ed30 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Fri, 13 Nov 2015 14:45:18 +0000 Subject: [PATCH 05/32] Renaming canExecute() to canRunZeroConfig() to avoid confusion with isAllowedInStage() --- PHPCI/Model/Build.php | 2 +- PHPCI/Plugin.php | 4 ++++ PHPCI/Plugin/AbstractPlugin.php | 17 ++++++++++++++++- PHPCI/Plugin/Codeception.php | 2 +- PHPCI/Plugin/Composer.php | 2 +- PHPCI/Plugin/PhpCodeSniffer.php | 2 +- PHPCI/Plugin/PhpDocblockChecker.php | 2 +- PHPCI/Plugin/PhpLoc.php | 2 +- PHPCI/Plugin/PhpMessDetector.php | 2 +- PHPCI/Plugin/PhpUnit.php | 2 +- PHPCI/Plugin/TechnicalDebt.php | 2 +- PHPCI/ZeroConfigPlugin.php | 2 +- 12 files changed, 30 insertions(+), 11 deletions(-) diff --git a/PHPCI/Model/Build.php b/PHPCI/Model/Build.php index a8bfd683..859c069b 100644 --- a/PHPCI/Model/Build.php +++ b/PHPCI/Model/Build.php @@ -168,7 +168,7 @@ class Build extends BuildBase } foreach (array('setup', 'test', 'complete', 'success', 'failure') as $stage) { - if ($className::canExecute($stage, $builder, $this)) { + if ($className::canRunZeroConfig($stage, $builder, $this)) { $config[$stage][$className] = array( 'zero_config' => true ); diff --git a/PHPCI/Plugin.php b/PHPCI/Plugin.php index 23a2bbda..40df598c 100644 --- a/PHPCI/Plugin.php +++ b/PHPCI/Plugin.php @@ -9,12 +9,16 @@ namespace PHPCI; +use PHPCI\Builder; +use PHPCI\Model\Build; + /** * PHPCI Plugin Interface - Used by all build plugins. * @author Dan Cryer */ interface Plugin { + public static function canRunZeroConfig($stage, Builder $builder, Build $build); public function isAllowedInStage($stage); public function execute(); } diff --git a/PHPCI/Plugin/AbstractPlugin.php b/PHPCI/Plugin/AbstractPlugin.php index fd78d00b..d9bc693e 100644 --- a/PHPCI/Plugin/AbstractPlugin.php +++ b/PHPCI/Plugin/AbstractPlugin.php @@ -2,6 +2,8 @@ namespace PHPCI\Plugin; +use PHPCI\Builder; +use PHPCI\Model\Build; use PHPCI\Plugin; /** @@ -12,7 +14,7 @@ abstract class AbstractPlugin implements Plugin { /** * Define the stages that this plugin is allowed to run in. - * @see AbstractPlugin::canExecute() + * @see AbstractPlugin::isAllowedInStage() * @var array */ protected $allowedStages = array('setup', 'test', 'complete', 'success', 'failure', 'fixed', 'broken'); @@ -27,6 +29,19 @@ abstract class AbstractPlugin implements Plugin return in_array($stage, $this->allowedStages); } + /** + * Check whether or not this plugin can execute in zero config mode. + * Many plugins will check if their required config files can be found here. + * @param string $stage + * @param Builder $builder + * @param Build $build + * @return bool + */ + public static function canRunZeroConfig($stage, Builder $builder, Build $build) + { + return false; + } + /** * Execute the plugin and return its success or failure. * @return bool diff --git a/PHPCI/Plugin/Codeception.php b/PHPCI/Plugin/Codeception.php index f3eca9e5..5d99a9d6 100644 --- a/PHPCI/Plugin/Codeception.php +++ b/PHPCI/Plugin/Codeception.php @@ -56,7 +56,7 @@ class Codeception extends AbstractPlugin implements ZeroConfigPlugin * @param Build $build * @return bool */ - public static function canExecute($stage, Builder $builder, Build $build) + public static function canRunZeroConfig($stage, Builder $builder, Build $build) { return $stage == 'test' && !is_null(self::findConfigFile($builder->buildPath)); } diff --git a/PHPCI/Plugin/Composer.php b/PHPCI/Plugin/Composer.php index 12938868..0d4b57de 100644 --- a/PHPCI/Plugin/Composer.php +++ b/PHPCI/Plugin/Composer.php @@ -37,7 +37,7 @@ class Composer extends AbstractPlugin implements ZeroConfigPlugin * @param Build $build * @return bool */ - public static function canExecute($stage, Builder $builder, Build $build) + public static function canRunZeroConfig($stage, Builder $builder, Build $build) { $path = $builder->buildPath . DIRECTORY_SEPARATOR . 'composer.json'; diff --git a/PHPCI/Plugin/PhpCodeSniffer.php b/PHPCI/Plugin/PhpCodeSniffer.php index 8d072060..14da4cee 100644 --- a/PHPCI/Plugin/PhpCodeSniffer.php +++ b/PHPCI/Plugin/PhpCodeSniffer.php @@ -86,7 +86,7 @@ class PhpCodeSniffer extends AbstractPlugin implements ZeroConfigPlugin * @param Build $build * @return bool */ - public static function canExecute($stage, Builder $builder, Build $build) + public static function canRunZeroConfig($stage, Builder $builder, Build $build) { if ($stage == 'test') { return true; diff --git a/PHPCI/Plugin/PhpDocblockChecker.php b/PHPCI/Plugin/PhpDocblockChecker.php index 7c20e013..5993bcae 100644 --- a/PHPCI/Plugin/PhpDocblockChecker.php +++ b/PHPCI/Plugin/PhpDocblockChecker.php @@ -58,7 +58,7 @@ class PhpDocblockChecker extends AbstractPlugin implements ZeroConfigPlugin * @param Build $build * @return bool */ - public static function canExecute($stage, Builder $builder, Build $build) + public static function canRunZeroConfig($stage, Builder $builder, Build $build) { if ($stage == 'test') { return true; diff --git a/PHPCI/Plugin/PhpLoc.php b/PHPCI/Plugin/PhpLoc.php index c67c88f9..6c3293ac 100644 --- a/PHPCI/Plugin/PhpLoc.php +++ b/PHPCI/Plugin/PhpLoc.php @@ -38,7 +38,7 @@ class PhpLoc extends AbstractPlugin implements ZeroConfigPlugin * @param Build $build * @return bool */ - public static function canExecute($stage, Builder $builder, Build $build) + public static function canRunZeroConfig($stage, Builder $builder, Build $build) { if ($stage == 'test') { return true; diff --git a/PHPCI/Plugin/PhpMessDetector.php b/PHPCI/Plugin/PhpMessDetector.php index 11895f55..cf22b664 100644 --- a/PHPCI/Plugin/PhpMessDetector.php +++ b/PHPCI/Plugin/PhpMessDetector.php @@ -68,7 +68,7 @@ class PhpMessDetector extends AbstractPlugin implements ZeroConfigPlugin * @param Build $build * @return bool */ - public static function canExecute($stage, Builder $builder, Build $build) + public static function canRunZeroConfig($stage, Builder $builder, Build $build) { if ($stage == 'test') { return true; diff --git a/PHPCI/Plugin/PhpUnit.php b/PHPCI/Plugin/PhpUnit.php index 6923915c..199dc4ec 100644 --- a/PHPCI/Plugin/PhpUnit.php +++ b/PHPCI/Plugin/PhpUnit.php @@ -62,7 +62,7 @@ class PhpUnit extends AbstractPlugin implements ZeroConfigPlugin * @param Build $build * @return bool */ - public static function canExecute($stage, Builder $builder, Build $build) + public static function canRunZeroConfig($stage, Builder $builder, Build $build) { if ($stage == 'test' && !is_null(self::findConfigFile($builder->buildPath))) { return true; diff --git a/PHPCI/Plugin/TechnicalDebt.php b/PHPCI/Plugin/TechnicalDebt.php index e22d213e..15a5dc91 100755 --- a/PHPCI/Plugin/TechnicalDebt.php +++ b/PHPCI/Plugin/TechnicalDebt.php @@ -73,7 +73,7 @@ class TechnicalDebt extends AbstractPlugin implements ZeroConfigPlugin * @param Build $build * @return bool */ - public static function canExecute($stage, Builder $builder, Build $build) + public static function canRunZeroConfig($stage, Builder $builder, Build $build) { if ($stage == 'test') { return true; diff --git a/PHPCI/ZeroConfigPlugin.php b/PHPCI/ZeroConfigPlugin.php index 73f7746c..e0b1c5a6 100644 --- a/PHPCI/ZeroConfigPlugin.php +++ b/PHPCI/ZeroConfigPlugin.php @@ -17,5 +17,5 @@ use PHPCI\Model\Build; */ interface ZeroConfigPlugin { - public static function canExecute($stage, Builder $builder, Build $build); + public static function canRunZeroConfig($stage, Builder $builder, Build $build); } From 6eeddc9dc6d2bf70d791e5580687d1ae4d36c016 Mon Sep 17 00:00:00 2001 From: Stephen Ball Date: Sat, 14 Nov 2015 23:08:22 +0000 Subject: [PATCH 06/32] Added branch and update_only parameters Fixes #1127 --- PHPCI/Plugin/Deployer.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PHPCI/Plugin/Deployer.php b/PHPCI/Plugin/Deployer.php index 2db839e3..9c56a340 100644 --- a/PHPCI/Plugin/Deployer.php +++ b/PHPCI/Plugin/Deployer.php @@ -23,6 +23,7 @@ class Deployer implements \PHPCI\Plugin { protected $webhookUrl; protected $reason; + protected $updateOnly; /** * Set up the plugin, configure options, etc. @@ -43,6 +44,8 @@ class Deployer implements \PHPCI\Plugin if (isset($options['reason'])) { $this->reason = $options['reason']; } + + $this->updateOnly = isset($options['update_only']) ? (bool) $options['update_only'] : true; } /** @@ -61,6 +64,8 @@ class Deployer implements \PHPCI\Plugin 'reason' => $this->phpci->interpolate($this->reason), 'source' => 'PHPCI', 'url' => $this->phpci->interpolate('%BUILD_URI%'), + 'branch' => $this->phpci->interpolate('%BRANCH%'), + 'update_only' => $this->updateOnly )); return $response['success']; From 949bfc537600001162e6fea519a1dc872b125b7a Mon Sep 17 00:00:00 2001 From: Jonas Staudenmeir Date: Tue, 5 Jan 2016 16:21:21 +0100 Subject: [PATCH 07/32] Added default value in settings language select (current language). --- PHPCI/Controller/SettingsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PHPCI/Controller/SettingsController.php b/PHPCI/Controller/SettingsController.php index ea15bc3b..645e19a4 100644 --- a/PHPCI/Controller/SettingsController.php +++ b/PHPCI/Controller/SettingsController.php @@ -444,7 +444,7 @@ class SettingsController extends Controller $field->setClass('form-control'); $field->setContainerClass('form-group'); $field->setOptions(Lang::getLanguageOptions()); - $field->setValue('en'); + $field->setValue(Lang::getLanguage()); $form->addField($field); From 7f43f94cc043854c97322264aa95404e718b6526 Mon Sep 17 00:00:00 2001 From: Jonas Staudenmeir Date: Wed, 6 Jan 2016 00:24:42 +0100 Subject: [PATCH 08/32] Updated German translation. --- PHPCI/Languages/lang.de.php | 59 +++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/PHPCI/Languages/lang.de.php b/PHPCI/Languages/lang.de.php index cb7e3336..8e5bb3b2 100644 --- a/PHPCI/Languages/lang.de.php +++ b/PHPCI/Languages/lang.de.php @@ -39,7 +39,7 @@ PHPCI', 'reset_email_title' => 'PHPCI Passwort zurücksetzen für %s', 'reset_invalid' => 'Fehlerhafte Anfrage für das Zurücksetzen eines Passwortes', 'email_address' => 'Emailadresse', - 'login' => 'Login / Email Address', + 'login' => 'Login / Emailadresse', 'password' => 'Passwort', 'log_in' => 'Einloggen', @@ -103,7 +103,7 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab 'local' => 'Lokaler Pfad', 'hg' => 'Mercurial', 'svn' => 'Subversion', - + 'where_hosted' => 'Wo wird Ihr Projekt gehostet?', 'choose_github' => 'Wählen Sie ein GitHub Repository:', @@ -115,8 +115,8 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab (falls Sie Ihrem Projektrepository kein phpci.yml hinzufügen können)', 'default_branch' => 'Name des Standardbranches', 'allow_public_status' => 'Öffentliche Statusseite und -bild für dieses Projekt einschalten?', - 'archived' => 'Archived', - 'archived_menu' => 'Archived', + 'archived' => 'Archiviert', + 'archived_menu' => 'Archiviert', 'save_project' => 'Projekt speichern', 'error_mercurial' => 'Mercurial Repository-URL muss mit http://, oder https:// beginnen', @@ -130,7 +130,7 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab 'all_branches' => 'Alle Branches', 'builds' => 'Builds', 'id' => 'ID', - 'date' => 'Date', + 'date' => 'Datum', 'project' => 'Projekt', 'commit' => 'Commit', 'branch' => 'Branch', @@ -151,6 +151,9 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab 'webhooks_help_bitbucket' => 'Um für dieses Projekt automatisch einen Build zu starten, wenn neue Commits gepushed werden, fügen Sie die untenstehende URL als "POST" Service in der Services-Sektion Ihres Bitbucket Repositories hinzu.', // View Build + 'errors' => 'Fehler', + 'information' => 'Information', + 'build_x_not_found' => 'Build mit ID %d existiert nicht.', 'build_n' => 'Build %d', 'rebuild_now' => 'Build neu starten', @@ -192,8 +195,8 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab 'codeception_suite' => 'Suite', 'codeception_time' => 'Zeit', 'codeception_synopsis' => '%1$d Tests in %2$f Sekunden ausgeführt. - %3$d Fehler.', - + %3$d Fehler.', + 'file' => 'Datei', 'line' => 'Zeile', 'class' => 'Klasse', @@ -209,14 +212,14 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab 'build_created' => 'Build erstellt', 'build_started' => 'Build gestartet', 'build_finished' => 'Build abgeschlossen', - 'test_message' => 'Message', - 'test_no_message' => 'No message', - 'test_success' => 'Successful: %d', - 'test_fail' => 'Failures: %d', - 'test_skipped' => 'Skipped: %d', - 'test_error' => 'Errors: %d', + 'test_message' => 'Nachricht', + 'test_no_message' => 'Keine Nachricht', + 'test_success' => 'Erfolgreich: %d', + 'test_fail' => 'Fehlschläge: %d', + 'test_skipped' => 'Übersprungen: %d', + 'test_error' => 'Fehler: %d', 'test_todo' => 'Todos: %d', - 'test_total' => '%d test(s)', + 'test_total' => '%d Test(s)', // Users 'name' => 'Name', @@ -292,6 +295,19 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab 'search_packagist_for_more' => 'Packagist nach mehr Packages durchsuchen', 'search' => 'Suchen »', + // Summary plugin + 'build-summary' => 'Zusammenfassung', + 'stage' => 'Abschnitt', + 'duration' => 'Dauer', + 'plugin' => 'Plugin', + 'stage_setup' => 'Vorbereitung', + 'stage_test' => 'Test', + 'stage_complete' => 'Vollständig', + 'stage_success' => 'Erfolg', + 'stage_failure' => 'Fehlschlag', + 'stage_broken' => 'Defekt', + 'stage_fixed' => 'Behoben', + // Installer 'installation_url' => 'PHPCI Installations-URL', 'db_host' => 'Datenbankserver', @@ -400,5 +416,18 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab 'build_file_missing' => 'Angegebene Builddatei existiert nicht.', 'property_file_missing' => 'Angegebene Eigenschaftsdatei existiert nicht.', 'could_not_process_report' => 'Konnte den von diesem Tool erstellten Bericht nicht verarbeiten.', - 'shell_not_enabled' => 'Das Shell-Plugin ist nicht aktiviert. Bitte aktivieren Sie es via config.yml.' + 'shell_not_enabled' => 'Das Shell-Plugin ist nicht aktiviert. Bitte aktivieren Sie es via config.yml.', + + // Error Levels: + 'critical' => 'Kritisch', + 'high' => 'Hoch', + 'normal' => 'Normal', + 'low' => 'Niedrig', + + // Plugins that generate errors: + 'php_mess_detector' => 'PHP Mess Detector', + 'php_code_sniffer' => 'PHP Code Sniffer', + 'php_unit' => 'PHP Unit', + 'php_cpd' => 'PHP Copy/Paste Detector', + 'php_docblock_checker' => 'PHP Docblock Checker', ); From 9af9e0ec35ffbcab16ef8f5af173d950ba6da7c8 Mon Sep 17 00:00:00 2001 From: Leszek Date: Wed, 6 Jan 2016 22:01:38 +0000 Subject: [PATCH 09/32] Update Polish translation Contribution Type: improvement Primary Area: front-end Description of change: Updated Polish translation. --- PHPCI/Languages/lang.pl.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/PHPCI/Languages/lang.pl.php b/PHPCI/Languages/lang.pl.php index 837fea6e..e1d3c3bf 100644 --- a/PHPCI/Languages/lang.pl.php +++ b/PHPCI/Languages/lang.pl.php @@ -130,7 +130,7 @@ od wybranego kodu źródłowego platformy hostingowej.', 'all_branches' => 'Wszystkie Gałęzie', 'builds' => 'Budowania', 'id' => 'ID', - 'date' => 'Date', + 'date' => 'Data', 'project' => 'Projekt', 'commit' => 'Commit', 'branch' => 'Gałąź', @@ -206,14 +206,14 @@ Services repozytoria Bitbucket.', 'build_created' => 'Budowanie Stworzone', 'build_started' => 'Budowanie Rozpoczęte', 'build_finished' => 'Budowanie Zakończone', - 'test_message' => 'Message', - 'test_no_message' => 'No message', - 'test_success' => 'Successful: %d', - 'test_fail' => 'Failures: %d', - 'test_skipped' => 'Skipped: %d', - 'test_error' => 'Errors: %d', - 'test_todo' => 'Todos: %d', - 'test_total' => '%d test(s)', + 'test_message' => 'Wiadomość', + 'test_no_message' => 'Brak wiadomości', + 'test_success' => 'Powodzenie: %d', + 'test_fail' => 'Niepowodzenia: %d', + 'test_skipped' => 'Pominęte: %d', + 'test_error' => 'Błędy: %d', + 'test_todo' => 'Do zrobienia: %d', + 'test_total' => '%d test(ów)', // Users 'name' => 'Nazwa', @@ -344,10 +344,10 @@ Przejrzyj powyższą listę błędów przed kontynuowaniem.', 'incorrect_format' => 'Niepoprawny format', // Create Build Command - 'create_build_project' => 'Create a build for a project', - 'project_id_argument' => 'A project ID', - 'commit_id_option' => 'Commit ID to build', - 'branch_name_option' => 'Branch to build', + 'create_build_project' => 'Utwórz budowanie dla projektu', + 'project_id_argument' => 'ID projektu', + 'commit_id_option' => 'ID Commita do budowania', + 'branch_name_option' => 'Gałąź do budowania', // Run Command 'run_all_pending' => 'Uruchom wszystkie oczekujące budowy w PHPCI', From 2ddda7711e1272cf6591f274e09d45b9865f4a60 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Mon, 8 Feb 2016 11:44:35 +0000 Subject: [PATCH 10/32] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b30439e5..7d1280fc 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,6 @@ Contributions from others would be very much appreciated! Please read our [guide ##Questions? Your best place to go is the [mailing list](https://groups.google.com/forum/#!forum/php-ci), if you're already a member of the mailing list, you can simply email php-ci@googlegroups.com. + + +Test From 3c8ed45c46f400dbe1df33bd49ba3da883d101e0 Mon Sep 17 00:00:00 2001 From: Michael Schramm Date: Fri, 24 Jul 2015 12:36:02 +0200 Subject: [PATCH 11/32] implement bitbucket webhooks this fixes issue https://github.com/Block8/PHPCI/issues/1015 and adds support for the new bitbucket webhooks --- PHPCI/Controller/WebhookController.php | 60 +++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/PHPCI/Controller/WebhookController.php b/PHPCI/Controller/WebhookController.php index c448f163..95e94d15 100644 --- a/PHPCI/Controller/WebhookController.php +++ b/PHPCI/Controller/WebhookController.php @@ -80,11 +80,69 @@ class WebhookController extends \b8\Controller } /** - * Called by Bitbucket POST service. + * Called by Bitbucket. */ public function bitbucket($projectId) { $project = $this->fetchProject($projectId, 'bitbucket'); + + /* + * support both old services and new webhooks + */ + + if ($payload = $this->getParam('payload')) { + return $this->bitbucketService(json_decode($payload, true), $project); + } + + $payload = json_decode(file_get_contents("php://input"), true); + + if (empty($payload['push']['changes'])) { + /* + * invalid event from bitbucket + */ + return [ + 'status' => 'failed', + 'commits' => [] + ]; + } + + return $this->bitbucketWebhook($payload, $project); + } + + /** + * Bitbucket webhooks. + */ + protected function bitbucketWebhook($payload, $project) + { + $results = array(); + $status = 'failed'; + foreach ($payload['push']['changes'] as $commit) { + try { + $email = $commit['new']['target']['author']['raw']; + $email = substr($email, 0, strpos($email, '>')); + $email = substr($email, strpos($email, '<') + 1); + + $results[$commit['new']['target']['hash']] = $this->createBuild( + $project, + $commit['new']['target']['hash'], + $commit['new']['name'], + $email, + $commit['new']['target']['message'] + ); + $status = 'ok'; + } catch (Exception $ex) { + $results[$commit['new']['target']['hash']] = array('status' => 'failed', 'error' => $ex->getMessage()); + } + } + + return array('status' => $status, 'commits' => $results); + } + + /** + * Bitbucket POST service. + */ + protected function bitbucketService($payload, $project) + { $payload = json_decode($this->getParam('payload'), true); $results = array(); From 66ffea12f045a3c0b774ee52b382eef424dca9cb Mon Sep 17 00:00:00 2001 From: Michael Schramm Date: Fri, 24 Jul 2015 13:02:46 +0200 Subject: [PATCH 12/32] remove whitespace --- PHPCI/Controller/WebhookController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PHPCI/Controller/WebhookController.php b/PHPCI/Controller/WebhookController.php index 95e94d15..d2f9b694 100644 --- a/PHPCI/Controller/WebhookController.php +++ b/PHPCI/Controller/WebhookController.php @@ -101,7 +101,7 @@ class WebhookController extends \b8\Controller * invalid event from bitbucket */ return [ - 'status' => 'failed', + 'status' => 'failed', 'commits' => [] ]; } From fe9289eda5c5dae39aa29277c7c0d14436a446f3 Mon Sep 17 00:00:00 2001 From: Mike Bronner Date: Fri, 23 Oct 2015 13:55:04 -0700 Subject: [PATCH 13/32] Remove whitespace from empty lines, reformatted inline comments --- PHPCI/Controller/WebhookController.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/PHPCI/Controller/WebhookController.php b/PHPCI/Controller/WebhookController.php index d2f9b694..b43bd1cd 100644 --- a/PHPCI/Controller/WebhookController.php +++ b/PHPCI/Controller/WebhookController.php @@ -85,30 +85,25 @@ class WebhookController extends \b8\Controller public function bitbucket($projectId) { $project = $this->fetchProject($projectId, 'bitbucket'); - - /* - * support both old services and new webhooks - */ - + + // Support both old services and new webhooks if ($payload = $this->getParam('payload')) { return $this->bitbucketService(json_decode($payload, true), $project); } - + $payload = json_decode(file_get_contents("php://input"), true); - + if (empty($payload['push']['changes'])) { - /* - * invalid event from bitbucket - */ + // Invalid event from bitbucket return [ 'status' => 'failed', 'commits' => [] ]; } - + return $this->bitbucketWebhook($payload, $project); } - + /** * Bitbucket webhooks. */ @@ -137,7 +132,7 @@ class WebhookController extends \b8\Controller return array('status' => $status, 'commits' => $results); } - + /** * Bitbucket POST service. */ From f200bd0411067d9e221acf638b34f1056371040b Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 11:06:30 +0100 Subject: [PATCH 14/32] Fixing MySQL strict-mode install error. Fixes #977 Fixes #818 --- PHPCI/Migrations/20140730143702_fix_database_columns.php | 2 +- PHPCI/Migrations/20150203105015_fix_column_types.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/PHPCI/Migrations/20140730143702_fix_database_columns.php b/PHPCI/Migrations/20140730143702_fix_database_columns.php index 809fc878..a1ac2493 100644 --- a/PHPCI/Migrations/20140730143702_fix_database_columns.php +++ b/PHPCI/Migrations/20140730143702_fix_database_columns.php @@ -20,7 +20,7 @@ class FixDatabaseColumns extends AbstractMigration $build->changeColumn('project_id', 'integer', array('null' => false)); $build->changeColumn('commit_id', 'string', array('limit' => 50, 'null' => false)); $build->changeColumn('status', 'integer', array('null' => false)); - $build->changeColumn('log', 'text', array('null' => true, 'default' => '')); + $build->changeColumn('log', 'text', array('null' => true)); $build->changeColumn('branch', 'string', array('limit' => 50, 'null' => false, 'default' => 'master')); $build->changeColumn('created', 'datetime', array('null' => true)); $build->changeColumn('started', 'datetime', array('null' => true)); diff --git a/PHPCI/Migrations/20150203105015_fix_column_types.php b/PHPCI/Migrations/20150203105015_fix_column_types.php index f9bcf68a..53db2ad6 100644 --- a/PHPCI/Migrations/20150203105015_fix_column_types.php +++ b/PHPCI/Migrations/20150203105015_fix_column_types.php @@ -14,7 +14,6 @@ class FixColumnTypes extends AbstractMigration $build = $this->table('build'); $build->changeColumn('log', 'text', array( 'null' => true, - 'default' => '', 'limit' => MysqlAdapter::TEXT_MEDIUM, )); From 81eadcf3f579abda9469ea7198aa4f08d4d129cd Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 11:29:03 +0100 Subject: [PATCH 15/32] Contributing guidelines, issue template and PR template. --- .github/CONTRIBUTING.md | 41 ++++++++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE.md | 28 ++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 23 ++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..c2f33e73 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,41 @@ +Contributions to PHPCI are very much encouraged, and we do our best to make it as welcoming and simple as possible. + +### Before You Start +Before you start, please make sure that you are aware of, and agree to, the following conditions of contribution: + +* By making a contribution to PHPCI, you accept that you are granting copyright ownership for that contribution to Block 8 Limited - the company responsible for PHPCI. In countries where copyright reassignment is not permitted, you grant Block 8 Limited a perpetual, non-exclusive licence to use your contribution in any way and for any purpose. + +* By making a contribution to PHPCI, you accept that your code will be released under the open-source [BSD 2-Clause Licence](https://github.com/Block8/PHPCI/blob/master/LICENSE.md). + +Block 8 are committed to PHPCI being a truly free and open source project, providing easy to use continuous integration and testing to as many developers as possible. We may, at our sole discretion, provide paid services based upon PHPCI - but PHPCI will always remain free (as in cost, and freedom) and open source. + +### The Contribution Process + +1. If you are thinking of making a large change or feature addition, [open an issue](/Block8/PHPCI/issues) titled "Intent to implement: ". Describe your idea in detail and discuss it with the community. It might be that someone already has a plan, could help you out, or your idea may simply not be suitable for the project at this time. +2. Fork the PHPCI project on Github +3. Add a feature or fix a bug - We recommend that you do this on a branch within your repository. +4. Create a pull request containing just the one change you want to contribute back to PHPCI. If you have more than one feature or bug fix, please create separate branches within your repository, and then submit a separate pull request for each one. Your pull request should use the template detailed below. +5. We'll then review your pull request and give any necessary feedback, this could be: + * Suggestions to improve your implementation + * Questions + * Issues/bugs related to the change + * Coding standards pointers +6. Once everyone is happy with the submission, we'll merge it back into PHPCI. Your change will then be included in the next project release. + +### Not sure what to start with? +We maintain two labels within our issue tracker that may be of interest to new contributors: + +* [The "Easy Fix" List](https://github.com/Block8/PHPCI/labels/flag:easy-fix) +* [The "Priority" List](https://github.com/Block8/PHPCI/labels/flag:priority) + +### Coding Standards +We require that all contributions meet at least the following guidelines: + +* PSR-1 & PSR-2 compliance for all code +* Doc-blocks for all classes and methods +* All files must contain the standard file-level docblock, including the copyright, license and link tags. + +All pull requests will be checked against these standards. If you're modifying a file as part of your change which does not comply with the above, please make the necessary changes to bring it into compliance prior to submitting the pull request. + +### Other Requirements +When you're adding new features or functionality, or you're updating existing functionality, please ensure that the relevant documentation is also either created or updated on the Wiki. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..16692061 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,28 @@ +Before submitting your issue, please make sure that you've checked all of the checkboxes below. + +- [ ] You're running the [latest release](https://github.com/Block8/PHPCI/releases/latest) version of PHPCI. +- [ ] Ensure that you're running at least PHP 5.3.6, you can check this by running `php -v` +- [ ] You've run `composer install --no-dev -o` from the root of your installation. +- [ ] You have set up either the PHPCI [Worker](https://github.com/Block8/PHPCI/wiki/Run-Builds-Using-a-Worker), [Daemon](https://github.com/Block8/PHPCI/wiki/Run-Builds-Using-a-Daemon) or [Cron Job](https://github.com/Block8/PHPCI/wiki/Run-Builds-Using-Cron) to run builds. + +To help us better understand your issue, please answer the following. + +### Expected behaviour + +*Please describe what you're expecting to see happen.* + +### Actual behaviour + +*Please describe what you're actually seeing happen.* + +### Steps to reproduce + +*If your issue requires any specific steps to reproduce, please outline them here.* + +### Environment info +Operating System: +PHP Version: +MySQL Version: + +### Logs or other output that would be helpful +(If logs are large, please upload as attachment). \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..65d060ab --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,23 @@ +Contribution Type: bug fix | new plugin | new feature | refactor | cosmetic +Link to Intent to Implement: +Link to Bug: + +This pull request affects the following areas: + +* [ ] Front-End +* [ ] Builder +* [ ] Build Plugins + +**In raising this pull request, I confirm the following (please check boxes):** + +- [ ] I have read and understood the [contributing guidelines](/.github/CONTRIBUTING.md)? +- [ ] I have checked that another pull request for this purpose does not exist. +- [ ] I have considered, and confirmed that this submission will be valuable to others. +- [ ] I have created or updated the relevant documentation for this change on the PHPCI Wiki. +- [ ] Do the PHPCI tests pass? + + +Detailed description of change: + + + From cc6d0f296451b57968ad5b89ddd847f968d007f0 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 11:43:57 +0100 Subject: [PATCH 16/32] Updating dependencies --- composer.lock | 460 +++++++++++++++++++++++++++++--------------------- 1 file changed, 267 insertions(+), 193 deletions(-) diff --git a/composer.lock b/composer.lock index 18b8d3de..9714ff78 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "f6333ad0763856ed7556296617a7c190", - "content-hash": "6ad9542b5f5959b67d94baf77e2fc45a", + "hash": "de65276e03e231d7072c744a3c63662e", + "content-hash": "1d9f6f487e6d906bbed73e2667c276d6", "packages": [ { "name": "block8/b8framework", @@ -151,16 +151,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.1.0", + "version": "6.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "66fd14b4d0b8f2389eaf37c5458608c7cb793a81" + "reference": "d094e337976dff9d8e2424e8485872194e768662" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/66fd14b4d0b8f2389eaf37c5458608c7cb793a81", - "reference": "66fd14b4d0b8f2389eaf37c5458608c7cb793a81", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d094e337976dff9d8e2424e8485872194e768662", + "reference": "d094e337976dff9d8e2424e8485872194e768662", "shasum": "" }, "require": { @@ -176,7 +176,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.1-dev" + "dev-master": "6.2-dev" } }, "autoload": { @@ -209,20 +209,20 @@ "rest", "web service" ], - "time": "2015-09-08 17:36:26" + "time": "2016-03-21 20:02:09" }, { "name": "guzzlehttp/promises", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "97fe7210def29451ec74923b27e552238defd75a" + "reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/97fe7210def29451ec74923b27e552238defd75a", - "reference": "97fe7210def29451ec74923b27e552238defd75a", + "url": "https://api.github.com/repos/guzzle/promises/zipball/bb9024c526b22f3fe6ae55a561fd70653d470aa8", + "reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8", "shasum": "" }, "require": { @@ -260,20 +260,20 @@ "keywords": [ "promise" ], - "time": "2015-08-15 19:37:21" + "time": "2016-03-08 01:15:46" }, { "name": "guzzlehttp/psr7", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e" + "reference": "31382fef2889136415751badebbd1cb022a4ed72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/4ef919b0cf3b1989523138b60163bbcb7ba1ff7e", - "reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/31382fef2889136415751badebbd1cb022a4ed72", + "reference": "31382fef2889136415751badebbd1cb022a4ed72", "shasum": "" }, "require": { @@ -318,7 +318,7 @@ "stream", "uri" ], - "time": "2015-08-15 19:32:36" + "time": "2016-04-13 19:56:01" }, { "name": "hipchat/hipchat-php", @@ -455,16 +455,16 @@ }, { "name": "monolog/monolog", - "version": "1.17.2", + "version": "1.19.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24" + "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bee7f0dc9c3e0b69a6039697533dca1e845c8c24", - "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5f56ed5212dc509c8dc8caeba2715732abb32dbf", + "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf", "shasum": "" }, "require": { @@ -479,13 +479,13 @@ "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", "phpunit/phpunit": "~4.5", "phpunit/phpunit-mock-objects": "2.3.0", "raven/raven": "^0.13", "ruflin/elastica": ">=0.90 <3.0", - "swiftmailer/swiftmailer": "~5.3", - "videlalvaro/php-amqplib": "~2.4" + "swiftmailer/swiftmailer": "~5.3" }, "suggest": { "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", @@ -493,16 +493,17 @@ "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", "ext-mongo": "Allow sending log messages to a MongoDB server", "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", "php-console/php-console": "Allow sending log messages to Google Chrome", "raven/raven": "Allow sending log messages to a Sentry server", "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.16.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -528,7 +529,7 @@ "logging", "psr-3" ], - "time": "2015-10-14 12:51:02" + "time": "2016-04-12 18:29:35" }, { "name": "mremi/flowdock", @@ -662,7 +663,9 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" } ], "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", @@ -762,27 +765,26 @@ }, { "name": "robmorgan/phinx", - "version": "v0.4.6", + "version": "v0.5.3", "source": { "type": "git", "url": "https://github.com/robmorgan/phinx.git", - "reference": "1351ca36dd2419d7de02afd1aaa415929112d7f1" + "reference": "4e7fee7792f4bf3dbf55ee29001850ba26c86a88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/robmorgan/phinx/zipball/1351ca36dd2419d7de02afd1aaa415929112d7f1", - "reference": "1351ca36dd2419d7de02afd1aaa415929112d7f1", + "url": "https://api.github.com/repos/robmorgan/phinx/zipball/4e7fee7792f4bf3dbf55ee29001850ba26c86a88", + "reference": "4e7fee7792f4bf3dbf55ee29001850ba26c86a88", "shasum": "" }, "require": { - "php": ">=5.3.2", - "symfony/config": "~2.7", - "symfony/console": "~2.7", - "symfony/yaml": "~2.7" + "php": ">=5.4", + "symfony/config": "~2.8|~3.0", + "symfony/console": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" }, "require-dev": { - "phpunit/phpunit": "3.7.*", - "squizlabs/php_codesniffer": "dev-phpcs-fixer" + "phpunit/phpunit": "^3.7|^4.0|^5.0" }, "bin": [ "bin/phinx" @@ -820,7 +822,7 @@ "migrations", "phinx" ], - "time": "2015-09-11 15:44:41" + "time": "2016-03-07 14:09:22" }, { "name": "sensiolabs/ansi-to-html", @@ -921,35 +923,38 @@ }, { "name": "symfony/config", - "version": "v2.7.5", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "9698fdf0a750d6887d5e7729d5cf099765b20e61" + "reference": "980ee40c28f00acff8906c11b778aab5f0db74c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/9698fdf0a750d6887d5e7729d5cf099765b20e61", - "reference": "9698fdf0a750d6887d5e7729d5cf099765b20e61", + "url": "https://api.github.com/repos/symfony/config/zipball/980ee40c28f00acff8906c11b778aab5f0db74c2", + "reference": "980ee40c28f00acff8906c11b778aab5f0db74c2", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/filesystem": "~2.3" + "php": ">=5.5.9", + "symfony/filesystem": "~2.8|~3.0" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Config\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -967,30 +972,30 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2015-09-21 15:02:29" + "time": "2016-03-04 07:55:57" }, { "name": "symfony/console", - "version": "v2.7.5", + "version": "v2.8.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "06cb17c013a82f94a3d840682b49425cd00a2161" + "reference": "9a5aef5fc0d4eff86853d44202b02be8d5a20154" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/06cb17c013a82f94a3d840682b49425cd00a2161", - "reference": "06cb17c013a82f94a3d840682b49425cd00a2161", + "url": "https://api.github.com/repos/symfony/console/zipball/9a5aef5fc0d4eff86853d44202b02be8d5a20154", + "reference": "9a5aef5fc0d4eff86853d44202b02be8d5a20154", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.1" + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" }, "suggest": { "psr/log": "For using the console logger", @@ -1000,13 +1005,16 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1024,20 +1032,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2015-09-25 08:32:23" + "time": "2016-03-17 09:19:04" }, { "name": "symfony/event-dispatcher", - "version": "v2.7.5", + "version": "v2.8.4", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9" + "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ae4dcc2a8d3de98bd794167a3ccda1311597c5d9", - "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/47d2d8cade9b1c3987573d2943bb9352536cdb87", + "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87", "shasum": "" }, "require": { @@ -1045,11 +1053,10 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/stopwatch": "~2.3" + "symfony/config": "~2.0,>=2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" }, "suggest": { "symfony/dependency-injection": "", @@ -1058,13 +1065,16 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1082,38 +1092,38 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2015-09-22 13:49:29" + "time": "2016-03-07 14:04:32" }, { "name": "symfony/filesystem", - "version": "v2.7.5", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab" + "reference": "f82499a459dcade2ea56df94cc58b19c8bde3d20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/a17f8a17c20e8614c15b8e116e2f4bcde102cfab", - "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/f82499a459dcade2ea56df94cc58b19c8bde3d20", + "reference": "f82499a459dcade2ea56df94cc58b19c8bde3d20", "shasum": "" }, "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Filesystem\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1131,38 +1141,97 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2015-09-09 17:42:36" + "time": "2016-03-27 10:24:39" }, { - "name": "symfony/yaml", - "version": "v2.7.5", + "name": "symfony/polyfill-mbstring", + "version": "v1.1.1", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "1289d16209491b584839022f29257ad859b8532d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770", - "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d", + "reference": "1289d16209491b584839022f29257ad859b8532d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2016-01-20 09:13:37" + }, + { + "name": "symfony/yaml", + "version": "v2.8.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "584e52cb8f788a887553ba82db6caacb1d6260bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/584e52cb8f788a887553ba82db6caacb1d6260bb", + "reference": "584e52cb8f788a887553ba82db6caacb1d6260bb", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1180,7 +1249,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-09-14 14:14:09" + "time": "2016-03-04 07:54:35" } ], "packages-dev": [ @@ -1340,26 +1409,26 @@ }, { "name": "pdepend/pdepend", - "version": "2.2.1", + "version": "2.2.4", "source": { "type": "git", "url": "https://github.com/pdepend/pdepend.git", - "reference": "a77b6bede0afdd232155eb6f1de0b2826bcf2803" + "reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/a77b6bede0afdd232155eb6f1de0b2826bcf2803", - "reference": "a77b6bede0afdd232155eb6f1de0b2826bcf2803", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/b086687f3a01dc6bb92d633aef071d2c5dd0db06", + "reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06", "shasum": "" }, "require": { "php": ">=5.3.7", - "symfony/config": "^2.3.0", - "symfony/dependency-injection": "^2.3.0", - "symfony/filesystem": "^2.3.0" + "symfony/config": "^2.3.0|^3", + "symfony/dependency-injection": "^2.3.0|^3", + "symfony/filesystem": "^2.3.0|^3" }, "require-dev": { - "phpunit/phpunit": "^4.0.0", + "phpunit/phpunit": "^4.4.0,<4.8", "squizlabs/php_codesniffer": "^2.0.0" }, "bin": [ @@ -1367,8 +1436,8 @@ ], "type": "library", "autoload": { - "psr-0": { - "PDepend\\": "src/main/php/" + "psr-4": { + "PDepend\\": "src/main/php/PDepend" } }, "notification-url": "https://packagist.org/downloads/", @@ -1376,7 +1445,7 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2015-09-24 14:17:05" + "time": "2016-03-10 15:15:04" }, { "name": "phpdocumentor/reflection-docblock", @@ -1429,16 +1498,16 @@ }, { "name": "phploc/phploc", - "version": "2.1.4", + "version": "2.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phploc.git", - "reference": "6cdf01336c06d20825831fe8cee70764fe373585" + "reference": "50e063abd41833b3a5d29a2e8fbef5859ac28bdc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/6cdf01336c06d20825831fe8cee70764fe373585", - "reference": "6cdf01336c06d20825831fe8cee70764fe373585", + "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/50e063abd41833b3a5d29a2e8fbef5859ac28bdc", + "reference": "50e063abd41833b3a5d29a2e8fbef5859ac28bdc", "shasum": "" }, "require": { @@ -1478,24 +1547,24 @@ ], "description": "A tool for quickly measuring the size of a PHP project.", "homepage": "https://github.com/sebastianbergmann/phploc", - "time": "2015-08-04 07:41:00" + "time": "2015-10-22 13:44:19" }, { "name": "phpmd/phpmd", - "version": "2.3.2", + "version": "2.4.3", "source": { "type": "git", "url": "https://github.com/phpmd/phpmd.git", - "reference": "08b5bcd454a7148579b68931fc500d824afd3bb5" + "reference": "2b9c2417a18696dfb578b38c116cd0ddc19b256e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/08b5bcd454a7148579b68931fc500d824afd3bb5", - "reference": "08b5bcd454a7148579b68931fc500d824afd3bb5", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/2b9c2417a18696dfb578b38c116cd0ddc19b256e", + "reference": "2b9c2417a18696dfb578b38c116cd0ddc19b256e", "shasum": "" }, "require": { - "pdepend/pdepend": "~2.0", + "pdepend/pdepend": "^2.0.4", "php": ">=5.3.0" }, "require-dev": { @@ -1543,26 +1612,28 @@ "phpmd", "pmd" ], - "time": "2015-09-24 14:37:49" + "time": "2016-04-04 11:52:04" }, { "name": "phpspec/prophecy", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" + "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", + "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" + "sebastian/comparator": "~1.1", + "sebastian/recursion-context": "~1.0" }, "require-dev": { "phpspec/phpspec": "~2.0" @@ -1570,7 +1641,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.5.x-dev" } }, "autoload": { @@ -1603,7 +1674,7 @@ "spy", "stub" ], - "time": "2015-08-13 10:07:40" + "time": "2016-02-15 07:46:21" }, { "name": "phpunit/php-code-coverage", @@ -1847,16 +1918,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.13", + "version": "4.8.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "be067d6105286b74272facefc2697038f8807b77" + "reference": "a1066c562c52900a142a0e2bbf0582994671385e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/be067d6105286b74272facefc2697038f8807b77", - "reference": "be067d6105286b74272facefc2697038f8807b77", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e", + "reference": "a1066c562c52900a142a0e2bbf0582994671385e", "shasum": "" }, "require": { @@ -1915,7 +1986,7 @@ "testing", "xunit" ], - "time": "2015-10-14 13:49:40" + "time": "2016-03-14 06:16:08" }, { "name": "phpunit/phpunit-mock-objects", @@ -2039,28 +2110,28 @@ }, { "name": "sebastian/diff", - "version": "1.3.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "~4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -2083,24 +2154,24 @@ } ], "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ "diff" ], - "time": "2015-02-22 15:13:53" + "time": "2015-12-08 07:14:41" }, { "name": "sebastian/environment", - "version": "1.3.2", + "version": "1.3.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" + "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", + "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", "shasum": "" }, "require": { @@ -2137,7 +2208,7 @@ "environment", "hhvm" ], - "time": "2015-08-03 06:14:51" + "time": "2016-02-26 18:40:46" }, { "name": "sebastian/exporter", @@ -2207,20 +2278,20 @@ }, { "name": "sebastian/finder-facade", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/finder-facade.git", - "reference": "a520dcc3dd39160eea480daa3426f4fd419a327b" + "reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/a520dcc3dd39160eea480daa3426f4fd419a327b", - "reference": "a520dcc3dd39160eea480daa3426f4fd419a327b", + "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9", + "reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9", "shasum": "" }, "require": { - "symfony/finder": "~2.3", + "symfony/finder": "~2.3|~3.0", "theseer/fdomdocument": "~1.3" }, "type": "library", @@ -2242,20 +2313,20 @@ ], "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", "homepage": "https://github.com/sebastianbergmann/finder-facade", - "time": "2015-06-04 08:11:58" + "time": "2016-02-17 07:02:23" }, { "name": "sebastian/git", - "version": "2.0.1", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/git.git", - "reference": "2d5c139d0eedcb9e67e0e9ca08023be6e9b7b47b" + "reference": "38638de3e94830a5cd7a5956135589b967609cd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/git/zipball/2d5c139d0eedcb9e67e0e9ca08023be6e9b7b47b", - "reference": "2d5c139d0eedcb9e67e0e9ca08023be6e9b7b47b", + "url": "https://api.github.com/repos/sebastianbergmann/git/zipball/38638de3e94830a5cd7a5956135589b967609cd5", + "reference": "38638de3e94830a5cd7a5956135589b967609cd5", "shasum": "" }, "require": { @@ -2264,7 +2335,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -2287,7 +2358,7 @@ "keywords": [ "git" ], - "time": "2015-04-06 16:23:43" + "time": "2016-02-21 15:02:23" }, { "name": "sebastian/global-state", @@ -2342,16 +2413,16 @@ }, { "name": "sebastian/recursion-context", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", "shasum": "" }, "require": { @@ -2391,7 +2462,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21 08:04:50" + "time": "2015-11-11 19:50:13" }, { "name": "sebastian/version", @@ -2430,23 +2501,27 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.3.4", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "11a2545c44a5915f883e2e5ec12e14ed345e3ab2" + "reference": "1bcdf03b068a530ac1962ce671dead356eeba43b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/11a2545c44a5915f883e2e5ec12e14ed345e3ab2", - "reference": "11a2545c44a5915f883e2e5ec12e14ed345e3ab2", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1bcdf03b068a530ac1962ce671dead356eeba43b", + "reference": "1bcdf03b068a530ac1962ce671dead356eeba43b", "shasum": "" }, "require": { + "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", "php": ">=5.1.2" }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, "bin": [ "scripts/phpcs", "scripts/phpcbf" @@ -2454,7 +2529,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -2500,33 +2575,29 @@ "phpcs", "standards" ], - "time": "2015-09-09 00:18:50" + "time": "2016-04-03 22:58:34" }, { "name": "symfony/dependency-injection", - "version": "v2.7.5", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "422c3819b110f610d79c6f1dc38af23787dc790e" + "reference": "6a9058101b591edced21ca3c83c80a3978f5c6b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/422c3819b110f610d79c6f1dc38af23787dc790e", - "reference": "422c3819b110f610d79c6f1dc38af23787dc790e", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/6a9058101b591edced21ca3c83c80a3978f5c6b0", + "reference": "6a9058101b591edced21ca3c83c80a3978f5c6b0", "shasum": "" }, "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/expression-language": "<2.6" + "php": ">=5.5.9" }, "require-dev": { - "symfony/config": "~2.2", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.1" + "symfony/config": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" }, "suggest": { "symfony/config": "", @@ -2536,13 +2607,16 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\DependencyInjection\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2560,38 +2634,38 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2015-09-15 08:30:42" + "time": "2016-03-30 10:41:14" }, { "name": "symfony/finder", - "version": "v2.7.5", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8262ab605973afbb3ef74b945daabf086f58366f" + "reference": "c54e407b35bc098916704e9fd090da21da4c4f52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8262ab605973afbb3ef74b945daabf086f58366f", - "reference": "8262ab605973afbb3ef74b945daabf086f58366f", + "url": "https://api.github.com/repos/symfony/finder/zipball/c54e407b35bc098916704e9fd090da21da4c4f52", + "reference": "c54e407b35bc098916704e9fd090da21da4c4f52", "shasum": "" }, "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2609,7 +2683,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2015-09-19 19:59:23" + "time": "2016-03-10 11:13:05" }, { "name": "theseer/fdomdocument", From ffa593f1a3faf56c1259d232f2e444a06aeff902 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 12:02:13 +0100 Subject: [PATCH 17/32] Fixing PHPCS errors --- PHPCI/Controller/BuildStatusController.php | 1 - PHPCI/Store/BuildStore.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/PHPCI/Controller/BuildStatusController.php b/PHPCI/Controller/BuildStatusController.php index 0090e85f..62cb9ba7 100644 --- a/PHPCI/Controller/BuildStatusController.php +++ b/PHPCI/Controller/BuildStatusController.php @@ -104,7 +104,6 @@ class BuildStatusController extends \PHPCI\Controller } } } - } catch (\Exception $e) { $xml = new \SimpleXMLElement(''); } diff --git a/PHPCI/Store/BuildStore.php b/PHPCI/Store/BuildStore.php index 9974c7b3..d6feb084 100644 --- a/PHPCI/Store/BuildStore.php +++ b/PHPCI/Store/BuildStore.php @@ -165,6 +165,7 @@ class BuildStore extends BuildStoreBase $stmt->bindValue(':projectId', (int)$projectId, \PDO::PARAM_INT); $stmt->bindValue(':buildId', (int)$buildId, \PDO::PARAM_INT); $stmt->bindValue(':numResults', (int)$numResults, \PDO::PARAM_INT); + if (!is_null($branch)) { $stmt->bindValue(':branch', $branch, \PDO::PARAM_STR); } @@ -183,7 +184,6 @@ class BuildStore extends BuildStoreBase } else { return $rtn; } - } else { return null; } From e567088a005232eb14c01741043ec1a2410d90aa Mon Sep 17 00:00:00 2001 From: David Valdez Date: Wed, 27 Apr 2016 06:10:46 -0500 Subject: [PATCH 18/32] now take in account the errors in the codeception plugin (#1206) --- PHPCI/Plugin/Util/TestResultParsers/Codeception.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PHPCI/Plugin/Util/TestResultParsers/Codeception.php b/PHPCI/Plugin/Util/TestResultParsers/Codeception.php index 249579be..39f28666 100644 --- a/PHPCI/Plugin/Util/TestResultParsers/Codeception.php +++ b/PHPCI/Plugin/Util/TestResultParsers/Codeception.php @@ -20,6 +20,7 @@ class Codeception implements ParserInterface protected $totalTests; protected $totalTimeTaken; protected $totalFailures; + protected $totalErrors; /** * @param Builder $phpci @@ -47,6 +48,7 @@ class Codeception implements ParserInterface $this->totalTests += (int) $testsuite['tests']; $this->totalTimeTaken += (float) $testsuite['time']; $this->totalFailures += (int) $testsuite['failures']; + $this->totalErrors += (int) $testsuite['errors']; foreach ($testsuite->testcase as $testcase) { $testresult = array( @@ -67,9 +69,9 @@ class Codeception implements ParserInterface $testresult['feature'] = sprintf('%s::%s', $testresult['class'], $testresult['name']); } - if (isset($testcase->failure)) { + if (isset($testcase->failure) || isset($testcase->error)) { $testresult['pass'] = false; - $testresult['message'] = (string) $testcase->failure; + $testresult['message'] = isset($testcase->failure) ? (string) $testcase->failure : (string) $testcase->error; } else { $testresult['pass'] = true; } @@ -108,6 +110,6 @@ class Codeception implements ParserInterface */ public function getTotalFailures() { - return $this->totalFailures; + return $this->totalFailures + $this->totalErrors; } } From 1e2cbcaf3dcea50909b1ecb1119364e27127f870 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 12:33:05 +0100 Subject: [PATCH 19/32] Fixing duplicate error listing in builds. Closes #1130 --- PHPCI/View/Build/view.phtml | 1 - 1 file changed, 1 deletion(-) diff --git a/PHPCI/View/Build/view.phtml b/PHPCI/View/Build/view.phtml index 03f23368..61fafd33 100644 --- a/PHPCI/View/Build/view.phtml +++ b/PHPCI/View/Build/view.phtml @@ -149,7 +149,6 @@ - From 424f1c5c4b43e0ae0d5484a3e819ed541b2c2658 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 14:08:01 +0100 Subject: [PATCH 20/32] Removing Test from README --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 7d1280fc..b30439e5 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,3 @@ Contributions from others would be very much appreciated! Please read our [guide ##Questions? Your best place to go is the [mailing list](https://groups.google.com/forum/#!forum/php-ci), if you're already a member of the mailing list, you can simply email php-ci@googlegroups.com. - - -Test From 1e13538c280ae82f203711f1b933fd432aff8c3a Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 14:13:42 +0100 Subject: [PATCH 21/32] Updating README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b30439e5..fe47d4b1 100644 --- a/README.md +++ b/README.md @@ -20,16 +20,16 @@ We have a chat room for discussing PHPCI, you can access it here: [![Gitter](htt * You can mark certain plugins as being allowed to fail (but still run.) ##What it doesn't do (yet): -* Virtualised testing. *(In progress)* -* Multiple PHP-version tests. *(In progress)* +* Virtualised testing. +* Multiple PHP-version tests. * Install PEAR or PECL extensions. -* [Deployments](http://phpdeployment.org) +* Deployments - We strongly recommend using [Deployer](http://phpdeployment.org) ## Getting Started: We've got documentation on our website on [installing PHPCI](https://www.phptesting.org/install-phpci) and [adding support for PHPCI to your projects](https://www.phptesting.org/wiki/Adding-PHPCI-Support-to-Your-Projects). ##Contributing -Contributions from others would be very much appreciated! Please read our [guide to contributing](https://www.phptesting.org/wiki/Contributing-to-PHPCI) for more information on how to get involved. +Contributions from others would be very much appreciated! Please read our [guide to contributing](https://github.com/Block8/PHPCI/blob/master/.github/CONTRIBUTING.md) for more information on how to get involved. ##Questions? Your best place to go is the [mailing list](https://groups.google.com/forum/#!forum/php-ci), if you're already a member of the mailing list, you can simply email php-ci@googlegroups.com. From 5ead42a7c207fed2a130e5ef3e34d4a02be4332e Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 14:18:40 +0100 Subject: [PATCH 22/32] README tweaks. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fe47d4b1..910e15f7 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ PHPCI is a free and open source (BSD License) continuous integration tool specif We have a chat room for discussing PHPCI, you can access it here: [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/Block8/PHPCI?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) -##What it does: +## What it does: * Clones your project from Github, Bitbucket or a local path * Allows you to set up and tear down test databases. * Installs your project's Composer dependencies. @@ -19,7 +19,7 @@ We have a chat room for discussing PHPCI, you can access it here: [![Gitter](htt * You can mark directories for the plugins to ignore. * You can mark certain plugins as being allowed to fail (but still run.) -##What it doesn't do (yet): +### What it doesn't do (yet): * Virtualised testing. * Multiple PHP-version tests. * Install PEAR or PECL extensions. @@ -28,8 +28,8 @@ We have a chat room for discussing PHPCI, you can access it here: [![Gitter](htt ## Getting Started: We've got documentation on our website on [installing PHPCI](https://www.phptesting.org/install-phpci) and [adding support for PHPCI to your projects](https://www.phptesting.org/wiki/Adding-PHPCI-Support-to-Your-Projects). -##Contributing +## Contributing Contributions from others would be very much appreciated! Please read our [guide to contributing](https://github.com/Block8/PHPCI/blob/master/.github/CONTRIBUTING.md) for more information on how to get involved. -##Questions? -Your best place to go is the [mailing list](https://groups.google.com/forum/#!forum/php-ci), if you're already a member of the mailing list, you can simply email php-ci@googlegroups.com. +## Questions? +Your best place to go is the [mailing list](https://groups.google.com/forum/#!forum/php-ci). If you're already a member of the mailing list, you can simply email php-ci@googlegroups.com. From 21d5f4954fee6f12019500bbaf73b12ce0346a0f Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 14:56:52 +0100 Subject: [PATCH 23/32] Adding a debug mode to the worker so you can see what commands are being run. --- PHPCI/Command/WorkerCommand.php | 9 ++++++++- PHPCI/Helper/BaseCommandExecutor.php | 4 ++++ PHPCI/Logging/BuildLogger.php | 11 ++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/PHPCI/Command/WorkerCommand.php b/PHPCI/Command/WorkerCommand.php index 49685656..5ceb6a84 100644 --- a/PHPCI/Command/WorkerCommand.php +++ b/PHPCI/Command/WorkerCommand.php @@ -50,7 +50,8 @@ class WorkerCommand extends Command { $this ->setName('phpci:worker') - ->setDescription('Runs the PHPCI build worker.'); + ->setDescription('Runs the PHPCI build worker.') + ->addOption('debug', null, null, 'Run PHPCI in Debug Mode'); } protected function execute(InputInterface $input, OutputInterface $output) @@ -65,6 +66,12 @@ class WorkerCommand extends Command ); } + // Allow PHPCI to run in "debug mode" + if ($input->hasOption('debug') && $input->getOption('debug')) { + $output->writeln('Debug mode enabled.'); + define('PHPCI_DEBUG_MODE', true); + } + $config = Config::getInstance()->get('phpci.worker', []); if (empty($config['host']) || empty($config['queue'])) { diff --git a/PHPCI/Helper/BaseCommandExecutor.php b/PHPCI/Helper/BaseCommandExecutor.php index bd948834..ddfa78df 100644 --- a/PHPCI/Helper/BaseCommandExecutor.php +++ b/PHPCI/Helper/BaseCommandExecutor.php @@ -90,6 +90,10 @@ abstract class BaseCommandExecutor implements CommandExecutor $pipes = array(); + if (defined('PHPCI_DEBUG_MODE')) { + $this->logger->logDebug($command); + } + $process = proc_open($command, $descriptorSpec, $pipes, $this->buildPath, null); if (is_resource($process)) { diff --git a/PHPCI/Logging/BuildLogger.php b/PHPCI/Logging/BuildLogger.php index 73f3b464..cae5ff22 100644 --- a/PHPCI/Logging/BuildLogger.php +++ b/PHPCI/Logging/BuildLogger.php @@ -67,7 +67,7 @@ class BuildLogger implements LoggerAwareInterface } } - /** + /** * Add a success-coloured message to the log. * @param string */ @@ -98,6 +98,15 @@ class BuildLogger implements LoggerAwareInterface ); } + /** + * Add a debug message to the log. + * @param string + */ + public function logDebug($message) + { + $this->log("\033[0;33m" . $message . "\033[0m"); + } + /** * Sets a logger instance on the object * From 6418fde928e853dd1642902649e7697eceba31ab Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 15:20:20 +0100 Subject: [PATCH 24/32] Defaulting to using neither --prefer-source or --prefer-dist for composer. Allow user to specify either. --- .phpci.yml | 1 - PHPCI/Plugin/Composer.php | 14 +++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.phpci.yml b/.phpci.yml index b4fd52ec..d6ea0921 100644 --- a/.phpci.yml +++ b/.phpci.yml @@ -13,7 +13,6 @@ build_settings: setup: composer: action: "install" - prefer_dist: false test: php_parallel_lint: diff --git a/PHPCI/Plugin/Composer.php b/PHPCI/Plugin/Composer.php index bd5f6658..7bd86ac3 100644 --- a/PHPCI/Plugin/Composer.php +++ b/PHPCI/Plugin/Composer.php @@ -61,6 +61,7 @@ class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin $this->directory = $path; $this->action = 'install'; $this->preferDist = false; + $this->preferSource = false; $this->nodev = false; if (array_key_exists('directory', $options)) { @@ -75,6 +76,11 @@ class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin $this->preferDist = (bool)$options['prefer_dist']; } + if (array_key_exists('prefer_source', $options)) { + $this->preferDist = false; + $this->preferSource = (bool)$options['prefer_source']; + } + if (array_key_exists('no_dev', $options)) { $this->nodev = (bool)$options['no_dev']; } @@ -97,10 +103,12 @@ class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin if ($this->preferDist) { $this->phpci->log('Using --prefer-dist flag'); - $cmd .= '--prefer-dist'; - } else { + $cmd .= ' --prefer-dist'; + } + + if ($this->preferSource) { $this->phpci->log('Using --prefer-source flag'); - $cmd .= '--prefer-source'; + $cmd .= ' --prefer-source'; } if ($this->nodev) { From 21ba39e6ff3d1e10b292799df9aa9375873cd349 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 15:27:27 +0100 Subject: [PATCH 25/32] Fixes --- PHPCI/Helper/BaseCommandExecutor.php | 6 +----- PHPCI/Logging/BuildLogger.php | 4 +++- PHPCI/Plugin/Util/TestResultParsers/Codeception.php | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/PHPCI/Helper/BaseCommandExecutor.php b/PHPCI/Helper/BaseCommandExecutor.php index ddfa78df..b3b47f7b 100644 --- a/PHPCI/Helper/BaseCommandExecutor.php +++ b/PHPCI/Helper/BaseCommandExecutor.php @@ -76,6 +76,7 @@ abstract class BaseCommandExecutor implements CommandExecutor $this->lastOutput = array(); $command = call_user_func_array('sprintf', $args); + $this->logger->logDebug($command); if ($this->quiet) { $this->logger->log('Executing: ' . $command); @@ -89,11 +90,6 @@ abstract class BaseCommandExecutor implements CommandExecutor ); $pipes = array(); - - if (defined('PHPCI_DEBUG_MODE')) { - $this->logger->logDebug($command); - } - $process = proc_open($command, $descriptorSpec, $pipes, $this->buildPath, null); if (is_resource($process)) { diff --git a/PHPCI/Logging/BuildLogger.php b/PHPCI/Logging/BuildLogger.php index cae5ff22..a68e9e6d 100644 --- a/PHPCI/Logging/BuildLogger.php +++ b/PHPCI/Logging/BuildLogger.php @@ -104,7 +104,9 @@ class BuildLogger implements LoggerAwareInterface */ public function logDebug($message) { - $this->log("\033[0;33m" . $message . "\033[0m"); + if (defined('PHPCI_DEBUG_MODE') && PHPCI_DEBUG_MODE) { + $this->log("\033[0;33m" . $message . "\033[0m"); + } } /** diff --git a/PHPCI/Plugin/Util/TestResultParsers/Codeception.php b/PHPCI/Plugin/Util/TestResultParsers/Codeception.php index 39f28666..24af62e4 100644 --- a/PHPCI/Plugin/Util/TestResultParsers/Codeception.php +++ b/PHPCI/Plugin/Util/TestResultParsers/Codeception.php @@ -30,7 +30,6 @@ class Codeception implements ParserInterface { $this->phpci = $phpci; $this->resultsXml = $resultsXml; - $this->totalTests = 0; } @@ -71,7 +70,7 @@ class Codeception implements ParserInterface if (isset($testcase->failure) || isset($testcase->error)) { $testresult['pass'] = false; - $testresult['message'] = isset($testcase->failure) ? (string) $testcase->failure : (string) $testcase->error; + $testresult['message'] = (string)$testcase->failure . (string)$testcase->error; } else { $testresult['pass'] = true; } From 77e9710d092ebeb5c70ded195f5209d04cfe672d Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 15:45:24 +0100 Subject: [PATCH 26/32] Testing PHPMD error supression --- PHPCI/Controller/WebhookController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PHPCI/Controller/WebhookController.php b/PHPCI/Controller/WebhookController.php index b43bd1cd..4b444d03 100644 --- a/PHPCI/Controller/WebhookController.php +++ b/PHPCI/Controller/WebhookController.php @@ -27,6 +27,8 @@ use PHPCI\Store\ProjectStore; * @author Guillaume Perréal * @package PHPCI * @subpackage Web + * + * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ class WebhookController extends \b8\Controller { From 49db1a26bae7a0998bb81f2e3dd2a62037a2c86d Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 27 Apr 2016 16:40:55 +0100 Subject: [PATCH 27/32] Make sure we always show the correct error count on the build errors tab. --- PHPCI/Controller/BuildController.php | 2 +- PHPCI/Store/BuildErrorStore.php | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/PHPCI/Controller/BuildController.php b/PHPCI/Controller/BuildController.php index f68a739c..df8778f7 100644 --- a/PHPCI/Controller/BuildController.php +++ b/PHPCI/Controller/BuildController.php @@ -180,7 +180,7 @@ class BuildController extends \PHPCI\Controller $errorView->build = $build; $errorView->errors = $errors; - $data['errors'] = count($errors); + $data['errors'] = $errorStore->getErrorTotalForBuild($build->getId()); $data['error_html'] = $errorView->render(); $data['since'] = (new \DateTime())->format('Y-m-d H:i:s'); diff --git a/PHPCI/Store/BuildErrorStore.php b/PHPCI/Store/BuildErrorStore.php index 815a4d18..c2d32468 100644 --- a/PHPCI/Store/BuildErrorStore.php +++ b/PHPCI/Store/BuildErrorStore.php @@ -54,4 +54,27 @@ class BuildErrorStore extends BuildErrorStoreBase return array(); } } + + /** + * Gets the total number of errors for a given build. + * @param $buildId + * @param string $since date string + * @return array + */ + public function getErrorTotalForBuild($buildId) + { + $query = 'SELECT COUNT(*) AS total FROM build_error + WHERE build_id = :build'; + + $stmt = Database::getConnection('read')->prepare($query); + + $stmt->bindValue(':build', $buildId, \PDO::PARAM_INT); + + if ($stmt->execute()) { + $res = $stmt->fetch(\PDO::FETCH_ASSOC); + return $res['total']; + } else { + return array(); + } + } } From db93f5542770938e2a7b08747ec5a1d76c5a8f67 Mon Sep 17 00:00:00 2001 From: David Rimbault Date: Wed, 27 Apr 2016 17:59:29 +0200 Subject: [PATCH 28/32] [FIX] Running Complete stage even on Exception catch. (#1186) --- PHPCI/Builder.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PHPCI/Builder.php b/PHPCI/Builder.php index 0edc44d8..1aed3d3f 100644 --- a/PHPCI/Builder.php +++ b/PHPCI/Builder.php @@ -213,8 +213,6 @@ class Builder implements LoggerAwareInterface $this->build->setStatus(Build::STATUS_FAILED); } - // Complete stage plugins are always run - $this->pluginExecutor->executePlugins($this->config, 'complete'); if ($success) { $this->pluginExecutor->executePlugins($this->config, 'success'); @@ -236,6 +234,9 @@ class Builder implements LoggerAwareInterface } catch (\Exception $ex) { $this->build->setStatus(Build::STATUS_FAILED); $this->buildLogger->logFailure(Lang::get('exception') . $ex->getMessage()); + }finally{ + // Complete stage plugins are always run + $this->pluginExecutor->executePlugins($this->config, 'complete'); } From 3cdaef8fa9fc3a910b641fc428b41b0d87d1d902 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Fri, 3 Jun 2016 17:30:45 +0100 Subject: [PATCH 29/32] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 910e15f7..77683b91 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,12 @@ PHPCI is a free and open source (BSD License) continuous integration tool specif We have a chat room for discussing PHPCI, you can access it here: [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/Block8/PHPCI?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) +**Support the development of PHPCI** + +We [now accept donations](https://www.phptesting.org/support) to directly support the ongoing development of PHPCI. There is of course no obligation to donate, nor any commitment if you do. + +[Donate](https://www.phptesting.org/support) + ## What it does: * Clones your project from Github, Bitbucket or a local path * Allows you to set up and tear down test databases. From 4d0911f2a98dd35b73702a34c8725b7f73e597e8 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Thu, 23 Jun 2016 11:28:42 +0100 Subject: [PATCH 30/32] Bug fixes Signed-off-by: Dan Cryer --- PHPCI/Command/InstallCommand.php | 9 +++++ PHPCI/Controller/BuildController.php | 4 ++ PHPCI/Controller/ProjectController.php | 4 ++ PHPCI/Languages/lang.en.php | 3 ++ .../20160623100223_project_table_defaults.php | 18 +++++++++ PHPCI/Service/BuildService.php | 40 +++++++++++-------- PHPCI/View/layout.phtml | 8 ++++ 7 files changed, 70 insertions(+), 16 deletions(-) create mode 100644 PHPCI/Migrations/20160623100223_project_table_defaults.php diff --git a/PHPCI/Command/InstallCommand.php b/PHPCI/Command/InstallCommand.php index 318871a5..5f5cbd67 100644 --- a/PHPCI/Command/InstallCommand.php +++ b/PHPCI/Command/InstallCommand.php @@ -21,6 +21,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use PHPCI\Service\UserService; +use Symfony\Component\Console\Question\ConfirmationQuestion; /** * Install console command - Installs PHPCI. @@ -253,6 +254,14 @@ class InstallCommand extends Command $rtn = []; + $helper = $this->getHelper('question'); + $question = new ConfirmationQuestion('Use beanstalkd to manage build queue? ', true); + + if (!$helper->ask($input, $output, $question)) { + $output->writeln('Skipping beanstalkd configuration.'); + return null; + } + if (!$rtn['host'] = $input->getOption('queue-server')) { $rtn['host'] = $dialog->ask($output, 'Enter your beanstalkd hostname [localhost]: ', 'localhost'); } diff --git a/PHPCI/Controller/BuildController.php b/PHPCI/Controller/BuildController.php index df8778f7..55ccbb37 100644 --- a/PHPCI/Controller/BuildController.php +++ b/PHPCI/Controller/BuildController.php @@ -200,6 +200,10 @@ class BuildController extends \PHPCI\Controller $build = $this->buildService->createDuplicateBuild($copy); + if ($this->buildService->queueError) { + $_SESSION['global_error'] = Lang::get('add_to_queue_failed'); + } + $response = new b8\Http\Response\RedirectResponse(); $response->setHeader('Location', PHPCI_URL.'build/view/' . $build->getId()); return $response; diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php index be5dee19..72be46e5 100644 --- a/PHPCI/Controller/ProjectController.php +++ b/PHPCI/Controller/ProjectController.php @@ -116,6 +116,10 @@ class ProjectController extends PHPCI\Controller $email = $_SESSION['phpci_user']->getEmail(); $build = $this->buildService->createBuild($project, null, urldecode($branch), $email); + if ($this->buildService->queueError) { + $_SESSION['global_error'] = Lang::get('add_to_queue_failed'); + } + $response = new b8\Http\Response\RedirectResponse(); $response->setHeader('Location', PHPCI_URL.'build/view/' . $build->getId()); return $response; diff --git a/PHPCI/Languages/lang.en.php b/PHPCI/Languages/lang.en.php index eec2ee07..63df75d2 100644 --- a/PHPCI/Languages/lang.en.php +++ b/PHPCI/Languages/lang.en.php @@ -372,6 +372,9 @@ PHPCI', 'project_id_argument' => 'A project ID', 'commit_id_option' => 'Commit ID to build', 'branch_name_option' => 'Branch to build', + 'add_to_queue_failed' => 'Build created successfully, but failed to add to build queue. This usually happens + when PHPCI is set to use a beanstalkd server that does not exist, + or your beanstalkd server has stopped.', // Run Command 'run_all_pending' => 'Run all pending PHPCI builds.', diff --git a/PHPCI/Migrations/20160623100223_project_table_defaults.php b/PHPCI/Migrations/20160623100223_project_table_defaults.php new file mode 100644 index 00000000..079db327 --- /dev/null +++ b/PHPCI/Migrations/20160623100223_project_table_defaults.php @@ -0,0 +1,18 @@ +table('project') + ->changeColumn('build_config', MysqlAdapter::PHINX_TYPE_TEXT, array('null' => true)) + ->changeColumn('archived', MysqlAdapter::PHINX_TYPE_INTEGER, array( + 'length' => MysqlAdapter::INT_TINY, + 'default' => 0, + )) + ->save(); + } +} diff --git a/PHPCI/Service/BuildService.php b/PHPCI/Service/BuildService.php index dca0fc0d..a120a64e 100644 --- a/PHPCI/Service/BuildService.php +++ b/PHPCI/Service/BuildService.php @@ -30,6 +30,11 @@ class BuildService */ protected $buildStore; + /** + * @var bool + */ + public $queueError = false; + /** * @param BuildStore $buildStore */ @@ -155,27 +160,30 @@ class BuildService } $config = Config::getInstance(); - $settings = $config->get('phpci.worker', []); if (!empty($settings['host']) && !empty($settings['queue'])) { - $jobData = array( - 'type' => 'phpci.build', - 'build_id' => $build->getId(), - ); + try { + $jobData = array( + 'type' => 'phpci.build', + 'build_id' => $build->getId(), + ); - if ($config->get('using_custom_file')) { - $jobData['config'] = $config->getArray(); + if ($config->get('using_custom_file')) { + $jobData['config'] = $config->getArray(); + } + + $pheanstalk = new Pheanstalk($settings['host']); + $pheanstalk->useTube($settings['queue']); + $pheanstalk->put( + json_encode($jobData), + PheanstalkInterface::DEFAULT_PRIORITY, + PheanstalkInterface::DEFAULT_DELAY, + $config->get('phpci.worker.job_timeout', 600) + ); + } catch (\Exception $ex) { + $this->queueError = true; } - - $pheanstalk = new Pheanstalk($settings['host']); - $pheanstalk->useTube($settings['queue']); - $pheanstalk->put( - json_encode($jobData), - PheanstalkInterface::DEFAULT_PRIORITY, - PheanstalkInterface::DEFAULT_DELAY, - $config->get('phpci.worker.job_timeout', 600) - ); } } } diff --git a/PHPCI/View/layout.phtml b/PHPCI/View/layout.phtml index 2e105c18..1960aff6 100644 --- a/PHPCI/View/layout.phtml +++ b/PHPCI/View/layout.phtml @@ -292,6 +292,14 @@
+ ' . $message . ''; + } + ?> +
From 42ca1c65279b5fc2975df68d1a1a179801fe4914 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 29 Jun 2016 10:13:27 +0100 Subject: [PATCH 31/32] Fix for handling old unserialize mode. --- PHPCI/Model/Project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PHPCI/Model/Project.php b/PHPCI/Model/Project.php index 717b0d9a..4b5268b2 100644 --- a/PHPCI/Model/Project.php +++ b/PHPCI/Model/Project.php @@ -96,7 +96,7 @@ class Project extends ProjectBase $info = $this->data['access_information']; // Handle old-format (serialized) access information first: - if (!empty($info) && substr($info, 0, 1) != '{') { + if (!empty($info) && !in_array(substr($info, 0, 1), array('{', '['))) { $data = unserialize($info); } else { $data = json_decode($info, true); From 64b0f60368c6cc6a6373dc316510c276c2f508d4 Mon Sep 17 00:00:00 2001 From: Arnout Boks Date: Wed, 17 Aug 2016 13:35:21 +0200 Subject: [PATCH 32/32] Removed unused 'standard' option for PhpCpd plugin (#1249) --- PHPCI/Plugin/PhpCpd.php | 5 ----- 1 file changed, 5 deletions(-) mode change 100644 => 100755 PHPCI/Plugin/PhpCpd.php diff --git a/PHPCI/Plugin/PhpCpd.php b/PHPCI/Plugin/PhpCpd.php old mode 100644 new mode 100755 index 2424d41e..aa076d2d --- a/PHPCI/Plugin/PhpCpd.php +++ b/PHPCI/Plugin/PhpCpd.php @@ -50,17 +50,12 @@ class PhpCpd implements \PHPCI\Plugin $this->build = $build; $this->path = $phpci->buildPath; - $this->standard = 'PSR1'; $this->ignore = $phpci->ignore; if (!empty($options['path'])) { $this->path = $phpci->buildPath . $options['path']; } - if (!empty($options['standard'])) { - $this->standard = $options['standard']; - } - if (!empty($options['ignore'])) { $this->ignore = $options['ignore']; }