From 6c76208992bf1bf7fc245b4806f97e6d75e86d3a Mon Sep 17 00:00:00 2001 From: Alexander Pirogov Date: Thu, 18 Jul 2013 14:14:22 +0300 Subject: [PATCH 1/3] added smtp_encryption config parameter --- PHPCI/Command/InstallCommand.php | 1 + PHPCI/Plugin/Email.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/PHPCI/Command/InstallCommand.php b/PHPCI/Command/InstallCommand.php index ad9cbeb7..dea4e560 100644 --- a/PHPCI/Command/InstallCommand.php +++ b/PHPCI/Command/InstallCommand.php @@ -50,6 +50,7 @@ class InstallCommand extends Command $conf['phpci']['email_settings']['smtp_address'] = $this->ask('(Optional) Smtp server address: ', true); $conf['phpci']['email_settings']['smtp_port'] = $this->ask('(Optional) Smtp port: ', true); + $conf['phpci']['email_settings']['smtp_encryption'] = $this->ask('(Optional) Smtp encryption: ', true); $conf['phpci']['email_settings']['smtp_username'] = $this->ask('(Optional) Smtp Username: ', true); $conf['phpci']['email_settings']['smtp_password'] = $this->ask('(Optional) Smtp Password: ', true); $conf['phpci']['email_settings']['from_address'] = $this->ask('(Optional) Email address to send from: ', true); diff --git a/PHPCI/Plugin/Email.php b/PHPCI/Plugin/Email.php index ae7ced05..798a01b5 100644 --- a/PHPCI/Plugin/Email.php +++ b/PHPCI/Plugin/Email.php @@ -140,7 +140,8 @@ class Email implements \PHPCI\Plugin /** @var \Swift_SmtpTransport $transport */ $transport = \Swift_SmtpTransport::newInstance( $this->getMailConfig('smtp_address'), - $this->getMailConfig('smtp_port') + $this->getMailConfig('smtp_port'), + $this->getMailConfig('smtp_encryption') ); $transport->setUsername($this->getMailConfig('smtp_username')); $transport->setPassword($this->getMailConfig('smtp_password')); @@ -164,6 +165,8 @@ class Email implements \PHPCI\Plugin return null; case 'smtp_port': return '25'; + case 'smtp_encryption': + return null; case 'from_address': return "notifications-ci@phptesting.org"; default: From a137e9c0c6e05878468a9028bb8817a471ee3620 Mon Sep 17 00:00:00 2001 From: Alexander Pirogov Date: Thu, 18 Jul 2013 16:10:55 +0300 Subject: [PATCH 2/3] added prefer_dist option to composer plugin --- PHPCI/Plugin/Composer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PHPCI/Plugin/Composer.php b/PHPCI/Plugin/Composer.php index 42195f52..df2da277 100644 --- a/PHPCI/Plugin/Composer.php +++ b/PHPCI/Plugin/Composer.php @@ -19,6 +19,7 @@ class Composer implements \PHPCI\Plugin { protected $directory; protected $action; + protected $preferDist; protected $phpci; public function __construct(\PHPCI\Builder $phpci, array $options = array()) @@ -27,6 +28,7 @@ class Composer implements \PHPCI\Plugin $this->phpci = $phpci; $this->directory = isset($options['directory']) ? $path . '/' . $options['directory'] : $path; $this->action = isset($options['action']) ? $options['action'] : 'update'; + $this->preferDist = isset($options['prefer_dist']) ? $options['prefer_dist'] : true; } /** @@ -34,7 +36,7 @@ class Composer implements \PHPCI\Plugin */ public function execute() { - $cmd = PHPCI_DIR . 'composer.phar --prefer-dist --working-dir="%s" %s'; + $cmd = PHPCI_DIR . 'composer.phar '. ($this->preferDist ? '--prefer-dist' : null) .' --working-dir="%s" %s'; return $this->phpci->executeCommand($cmd, $this->directory, $this->action); } } From 2a0e6d2401328be10c8afdd38fae2c8287965ed7 Mon Sep 17 00:00:00 2001 From: Alexander Pirogov Date: Fri, 19 Jul 2013 16:40:16 +0300 Subject: [PATCH 3/3] added rules option to phpmd plugin --- PHPCI/Plugin/PhpMessDetector.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PHPCI/Plugin/PhpMessDetector.php b/PHPCI/Plugin/PhpMessDetector.php index ea6ff959..d2a2e3dc 100644 --- a/PHPCI/Plugin/PhpMessDetector.php +++ b/PHPCI/Plugin/PhpMessDetector.php @@ -18,10 +18,16 @@ namespace PHPCI\Plugin; class PhpMessDetector implements \PHPCI\Plugin { protected $directory; + /** + * Array of PHPMD rules. Possible values: codesize, unusedcode, naming, design, controversial + * @var array + */ + protected $rules; public function __construct(\PHPCI\Builder $phpci, array $options = array()) { $this->phpci = $phpci; + $this->rules = isset($options['rules']) ? (array)$options['rules'] : array('codesize', 'unusedcode', 'naming'); } /** @@ -35,7 +41,7 @@ class PhpMessDetector implements \PHPCI\Plugin $ignore = ' --exclude ' . implode(',', $this->phpci->ignore); } - $cmd = PHPCI_BIN_DIR . 'phpmd "%s" text codesize,unusedcode,naming %s'; - return $this->phpci->executeCommand($cmd, $this->phpci->buildPath, $ignore); + $cmd = PHPCI_BIN_DIR . 'phpmd "%s" text %s %s'; + return $this->phpci->executeCommand($cmd, $this->phpci->buildPath, implode(',', $this->rules), $ignore); } }