From 44d8ef56a12f7a744b32ae6818ac1a340a295164 Mon Sep 17 00:00:00 2001 From: Alexander Gansky Date: Tue, 22 Sep 2015 01:27:09 +0300 Subject: [PATCH 1/5] feat(master) add webhook for created pull request, refactoring controller --- PHPCI/Controller/WebhookController.php | 79 +++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/PHPCI/Controller/WebhookController.php b/PHPCI/Controller/WebhookController.php index 45a775ad..cf3c6ce7 100644 --- a/PHPCI/Controller/WebhookController.php +++ b/PHPCI/Controller/WebhookController.php @@ -80,11 +80,88 @@ class WebhookController extends \b8\Controller } /** - * Called by Bitbucket POST service. + * Called by Bitbucket. */ public function bitbucket($projectId) { $project = $this->fetchProject($projectId, 'bitbucket'); + + if ($payload = $this->getParam('payload')) { + return $this->bitbucketService(json_decode($payload, true), $project); + } + + $payload = json_decode(file_get_contents("php://input"), true); + + switch (true) { + case isset($payload['pullrequest_created']): + return $this->bitbucketCreatePullRequestWebhook($payload, $project); + break; + case isset($payload['push']['changes']): + return $this->bitbucketPushWebhook($payload, $project); + break; + default: + return array('status' => 'failed', 'commits' => array()); + break; + } + } + + /** + * Bitbucket webhooks for created "pull request". + */ + protected function bitbucketCreatePullRequestWebhook($payload, $project) + { + $results = array(); + $status = 'failed'; + try { + $results[] = $this->createBuild( + $project, + $payload['pullrequest_created']['source']['commit']['hash'], + $payload['pullrequest_created']['source']['branch']['name'], + $payload['pullrequest_created']['author']['username'], + $payload['pullrequest_created']['title'] + ); + $status = 'ok'; + } catch (Exception $ex) { + $results = array('status' => 'failed', 'error' => $ex->getMessage()); + } + + return array('status' => $status, 'commits' => $results); + } + + /** + * Bitbucket webhooks for "push". + */ + protected function bitbucketPushWebhook($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 (old style). + */ + protected function bitbucketService($payload, $project) + { $payload = json_decode($this->getParam('payload'), true); $results = array(); From 77b5e2bfd5f03695d2c8de35fcb47f6aa1a6e994 Mon Sep 17 00:00:00 2001 From: Alexander Gansky Date: Sat, 3 Oct 2015 14:21:20 +0300 Subject: [PATCH 2/5] fixinc CS --- PHPCI/Controller/WebhookController.php | 36 +++++++++++++++++++------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/PHPCI/Controller/WebhookController.php b/PHPCI/Controller/WebhookController.php index cf3c6ce7..49477e0c 100644 --- a/PHPCI/Controller/WebhookController.php +++ b/PHPCI/Controller/WebhookController.php @@ -81,6 +81,10 @@ class WebhookController extends \b8\Controller /** * Called by Bitbucket. + * + * @param int $projectId current project id + * + * @return array */ public function bitbucket($projectId) { @@ -107,6 +111,11 @@ class WebhookController extends \b8\Controller /** * Bitbucket webhooks for created "pull request". + * + * @param array $payload incoming request in payload + * @param Project $project current project + * + * @return array */ protected function bitbucketCreatePullRequestWebhook($payload, $project) { @@ -114,11 +123,11 @@ class WebhookController extends \b8\Controller $status = 'failed'; try { $results[] = $this->createBuild( - $project, - $payload['pullrequest_created']['source']['commit']['hash'], - $payload['pullrequest_created']['source']['branch']['name'], - $payload['pullrequest_created']['author']['username'], - $payload['pullrequest_created']['title'] + $project, + $payload['pullrequest_created']['source']['commit']['hash'], + $payload['pullrequest_created']['source']['branch']['name'], + $payload['pullrequest_created']['author']['username'], + $payload['pullrequest_created']['title'] ); $status = 'ok'; } catch (Exception $ex) { @@ -130,6 +139,13 @@ class WebhookController extends \b8\Controller /** * Bitbucket webhooks for "push". + * + * @param array $payload current request payload + * @param Project $project current project + * + * @throws Exception + * + * @return array */ protected function bitbucketPushWebhook($payload, $project) { @@ -142,11 +158,11 @@ class WebhookController extends \b8\Controller $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'] + $project, + $commit['new']['target']['hash'], + $commit['new']['name'], + $email, + $commit['new']['target']['message'] ); $status = 'ok'; } catch (Exception $ex) { From adbe87f45ec7dd858042cc5213ffba1fd8d924d5 Mon Sep 17 00:00:00 2001 From: Alexander Gansky Date: Wed, 21 Oct 2015 20:24:41 +0300 Subject: [PATCH 3/5] feat(master) fixing webhook controller phpdocs --- PHPCI/Controller/WebhookController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PHPCI/Controller/WebhookController.php b/PHPCI/Controller/WebhookController.php index 1f52e16e..0ec5702b 100644 --- a/PHPCI/Controller/WebhookController.php +++ b/PHPCI/Controller/WebhookController.php @@ -175,6 +175,11 @@ class WebhookController extends \b8\Controller /** * Bitbucket POST service (old style). + * + * @param array $payload incoming request in payload + * @param Project $project current project + * + * @return array */ protected function bitbucketService($payload, $project) { From 7b18f9912071157b730561319e02e63fa9978912 Mon Sep 17 00:00:00 2001 From: Alexander Gansky Date: Wed, 16 Dec 2015 14:27:14 +0200 Subject: [PATCH 4/5] feat(master) fix composer --- composer.json | 31 ++-- composer.lock | 492 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 313 insertions(+), 210 deletions(-) diff --git a/composer.json b/composer.json index a9080a94..e2223b02 100644 --- a/composer.json +++ b/composer.json @@ -1,39 +1,34 @@ { - "name" : "block8/phpci", - "description" : "Simple continuous integration for PHP projects.", + "name": "block8/phpci", + "description": "Simple continuous integration for PHP projects.", "minimum-stability": "stable", - "type" : "library", - "keywords" : ["php", "phpci", "ci", "continuous", "integration", "testing", "phpunit", "continuous integration", "jenkins", "travis"], - "homepage" : "http://www.phptesting.org/", - "license" : "BSD-2-Clause", - + "type": "library", + "keywords": ["php", "phpci", "ci", "continuous", "integration", "testing", "phpunit", "continuous integration", "jenkins", "travis"], + "homepage": "http://www.phptesting.org/", + "license": "BSD-2-Clause", "authors": [ { - "name" : "Dan Cryer", - "email" : "dan.cryer@block8.co.uk", + "name": "Dan Cryer", + "email": "dan.cryer@block8.co.uk", "homepage": "http://www.block8.co.uk", - "role" : "Developer" + "role": "Developer" } ], - "support": { - "email" : "hello+phpci@block8.co.uk", + "email": "hello+phpci@block8.co.uk", "issues": "https://github.com/Block8/PHPCI/issues", "source": "https://github.com/Block8/PHPCI" }, - "autoload": { "psr-4": { "PHPCI\\": "PHPCI" } }, - "autoload-dev": { "psr-4": { "Tests\\PHPCI\\": "Tests/PHPCI/" } }, - "require": { "php": ">=5.3.8", "ext-pdo": "*", @@ -51,9 +46,9 @@ "pda/pheanstalk": "~3.1", "maknz/slack": "~1.7", "hipchat/hipchat-php": "~1.4", - "mremi/flowdock": "~1.0" + "mremi/flowdock": "~1.0", + "mindteam/phpci-symfony2-plugin": "dev-master" }, - "require-dev": { "phpunit/phpunit": "~4.5", "phpmd/phpmd": "~2.0", @@ -62,7 +57,7 @@ "phploc/phploc": "~2.0", "jakub-onderka/php-parallel-lint": "0.8.*" }, - + "minimum-stability": "dev", "suggest": { "block8/php-docblock-checker": "PHP Docblock Checker", "phpmd/phpmd": "PHP Mess Detector", diff --git a/composer.lock b/composer.lock index 18b8d3de..0fb29dba 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": "ba26f5e5f84072165a21de0323839f22", + "content-hash": "3190a5156adf86f2b3641200629d5168", "packages": [ { "name": "block8/b8framework", @@ -56,16 +56,16 @@ }, { "name": "guzzle/guzzle", - "version": "v3.9.3", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle3.git", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" + "reference": "b3f5050cb6270c7a728a0b74ac2de50a262b3e02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/b3f5050cb6270c7a728a0b74ac2de50a262b3e02", + "reference": "b3f5050cb6270c7a728a0b74ac2de50a262b3e02", "shasum": "" }, "require": { @@ -147,20 +147,20 @@ "rest", "web service" ], - "time": "2015-03-18 18:23:50" + "time": "2015-04-29 17:06:53" }, { "name": "guzzlehttp/guzzle", - "version": "6.1.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "66fd14b4d0b8f2389eaf37c5458608c7cb793a81" + "reference": "4f11935f709ef5e279af9da062507e72bd356e1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/66fd14b4d0b8f2389eaf37c5458608c7cb793a81", - "reference": "66fd14b4d0b8f2389eaf37c5458608c7cb793a81", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4f11935f709ef5e279af9da062507e72bd356e1a", + "reference": "4f11935f709ef5e279af9da062507e72bd356e1a", "shasum": "" }, "require": { @@ -209,20 +209,20 @@ "rest", "web service" ], - "time": "2015-09-08 17:36:26" + "time": "2015-10-27 04:12:26" }, { "name": "guzzlehttp/promises", - "version": "1.0.2", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "97fe7210def29451ec74923b27e552238defd75a" + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/97fe7210def29451ec74923b27e552238defd75a", - "reference": "97fe7210def29451ec74923b27e552238defd75a", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea", + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea", "shasum": "" }, "require": { @@ -260,20 +260,20 @@ "keywords": [ "promise" ], - "time": "2015-08-15 19:37:21" + "time": "2015-10-15 22:28:00" }, { "name": "guzzlehttp/psr7", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e" + "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/4ef919b0cf3b1989523138b60163bbcb7ba1ff7e", - "reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982", + "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982", "shasum": "" }, "require": { @@ -318,7 +318,7 @@ "stream", "uri" ], - "time": "2015-08-15 19:32:36" + "time": "2015-11-03 01:34:55" }, { "name": "hipchat/hipchat-php", @@ -364,16 +364,16 @@ }, { "name": "ircmaxell/password-compat", - "version": "v1.0.4", + "version": "1.0.x-dev", "source": { "type": "git", "url": "https://github.com/ircmaxell/password_compat.git", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" + "reference": "9b99377557a33a4129c9194e60a97a685fab21e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", + "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/9b99377557a33a4129c9194e60a97a685fab21e0", + "reference": "9b99377557a33a4129c9194e60a97a685fab21e0", "shasum": "" }, "require-dev": { @@ -402,7 +402,7 @@ "hashing", "password" ], - "time": "2014-11-20 16:49:30" + "time": "2014-11-20 19:18:42" }, { "name": "maknz/slack", @@ -453,6 +453,44 @@ ], "time": "2015-06-03 03:35:16" }, + { + "name": "mindteam/phpci-symfony2-plugin", + "version": "dev-master", + "target-dir": "Mindteam/PHPCI/Plugin", + "source": { + "type": "git", + "url": "https://github.com/mindteam/phpci-symfony2-plugin.git", + "reference": "fed8aa8102de2da0930e0d1a46f9d2eeac176add" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mindteam/phpci-symfony2-plugin/zipball/fed8aa8102de2da0930e0d1a46f9d2eeac176add", + "reference": "fed8aa8102de2da0930e0d1a46f9d2eeac176add", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/yaml": "~2.1" + }, + "type": "library", + "autoload": { + "psr-0": { + "Mindteam\\PHPCI\\Plugin": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alexander Gansky", + "email": "a.gansky@mindteam.com.ua" + } + ], + "description": "PHPCI plugin for using Symfony2 commands", + "time": "2015-11-12 17:11:10" + }, { "name": "monolog/monolog", "version": "1.17.2", @@ -579,16 +617,16 @@ }, { "name": "pda/pheanstalk", - "version": "v3.1.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/pda/pheanstalk.git", - "reference": "430e77c551479aad0c6ada0450ee844cf656a18b" + "reference": "ba8c8b1c3265d4a925864bfffe04c806c3364803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pda/pheanstalk/zipball/430e77c551479aad0c6ada0450ee844cf656a18b", - "reference": "430e77c551479aad0c6ada0450ee844cf656a18b", + "url": "https://api.github.com/repos/pda/pheanstalk/zipball/ba8c8b1c3265d4a925864bfffe04c806c3364803", + "reference": "ba8c8b1c3265d4a925864bfffe04c806c3364803", "shasum": "" }, "require": { @@ -600,7 +638,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -625,20 +663,20 @@ "keywords": [ "beanstalkd" ], - "time": "2015-08-07 21:42:41" + "time": "2015-09-01 22:39:31" }, { "name": "pimple/pimple", - "version": "v1.1.1", + "version": "1.1.x-dev", "source": { "type": "git", "url": "https://github.com/silexphp/Pimple.git", - "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d" + "reference": "bc2fc12cdf1f29bcad9e650d493a54a8fd1f3d85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d", - "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/bc2fc12cdf1f29bcad9e650d493a54a8fd1f3d85", + "reference": "bc2fc12cdf1f29bcad9e650d493a54a8fd1f3d85", "shasum": "" }, "require": { @@ -671,11 +709,11 @@ "container", "dependency injection" ], - "time": "2013-11-22 08:30:29" + "time": "2014-04-20 07:24:09" }, { "name": "psr/http-message", - "version": "1.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", @@ -724,22 +762,30 @@ }, { "name": "psr/log", - "version": "1.0.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + "reference": "9e45edca52cc9c954680072c93e621f8b71fab26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "url": "https://api.github.com/repos/php-fig/log/zipball/9e45edca52cc9c954680072c93e621f8b71fab26", + "reference": "9e45edca52cc9c954680072c93e621f8b71fab26", "shasum": "" }, + "require": { + "php": ">=5.3.0" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { - "psr-0": { - "Psr\\Log\\": "" + "psr-4": { + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -758,7 +804,7 @@ "psr", "psr-3" ], - "time": "2012-12-21 11:40:51" + "time": "2015-06-02 13:48:41" }, { "name": "robmorgan/phinx", @@ -824,7 +870,7 @@ }, { "name": "sensiolabs/ansi-to-html", - "version": "v1.1.2", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/sensiolabs/ansi-to-html.git", @@ -868,16 +914,16 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v5.4.1", + "version": "5.x-dev", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421" + "reference": "6522539daf0a7bdada1cc2dccb7ec37dc0712136" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/0697e6aa65c83edf97bb0f23d8763f94e3f11421", - "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/6522539daf0a7bdada1cc2dccb7ec37dc0712136", + "reference": "6522539daf0a7bdada1cc2dccb7ec37dc0712136", "shasum": "" }, "require": { @@ -917,39 +963,39 @@ "mail", "mailer" ], - "time": "2015-06-06 14:19:39" + "time": "2015-09-04 05:47:20" }, { "name": "symfony/config", - "version": "v2.7.5", + "version": "2.8.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "9698fdf0a750d6887d5e7729d5cf099765b20e61" + "reference": "f042c9257b2bdebda285f7a5c089b9348bcb6f3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/9698fdf0a750d6887d5e7729d5cf099765b20e61", - "reference": "9698fdf0a750d6887d5e7729d5cf099765b20e61", + "url": "https://api.github.com/repos/symfony/config/zipball/f042c9257b2bdebda285f7a5c089b9348bcb6f3d", + "reference": "f042c9257b2bdebda285f7a5c089b9348bcb6f3d", "shasum": "" }, "require": { "php": ">=5.3.9", - "symfony/filesystem": "~2.3" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "symfony/filesystem": "~2.3|~3.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Config\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -967,30 +1013,30 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2015-09-21 15:02:29" + "time": "2015-11-02 20:29:24" }, { "name": "symfony/console", - "version": "v2.7.5", + "version": "2.8.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "06cb17c013a82f94a3d840682b49425cd00a2161" + "reference": "74bf9202a531cc6942454eb9e2dd1e13bde34a31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/06cb17c013a82f94a3d840682b49425cd00a2161", - "reference": "06cb17c013a82f94a3d840682b49425cd00a2161", + "url": "https://api.github.com/repos/symfony/console/zipball/74bf9202a531cc6942454eb9e2dd1e13bde34a31", + "reference": "74bf9202a531cc6942454eb9e2dd1e13bde34a31", "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 +1046,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 +1073,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2015-09-25 08:32:23" + "time": "2015-11-04 00:47:19" }, { "name": "symfony/event-dispatcher", - "version": "v2.7.5", + "version": "2.8.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9" + "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc" }, "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/a5eb815363c0388e83247e7e9853e5dbc14999cc", + "reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc", "shasum": "" }, "require": { @@ -1045,11 +1094,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 +1106,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 +1133,38 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2015-09-22 13:49:29" + "time": "2015-10-30 20:15:42" }, { "name": "symfony/filesystem", - "version": "v2.7.5", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab" + "reference": "232aa96494f0b44d25c8b7a11163c742e568c1a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/a17f8a17c20e8614c15b8e116e2f4bcde102cfab", - "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/232aa96494f0b44d25c8b7a11163c742e568c1a7", + "reference": "232aa96494f0b44d25c8b7a11163c742e568c1a7", "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 +1182,94 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2015-09-09 17:42:36" + "time": "2015-11-10 13:34:42" }, { - "name": "symfony/yaml", - "version": "v2.7.5", + "name": "symfony/polyfill-mbstring", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0b6a8940385311a24e060ec1fe35680e17c74497" }, "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/0b6a8940385311a24e060ec1fe35680e17c74497", + "reference": "0b6a8940385311a24e060ec1fe35680e17c74497", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-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": "2015-11-04 20:28:58" + }, + { + "name": "symfony/yaml", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "5ff00ea2999343d42398fcb793bbfc64c92235ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/5ff00ea2999343d42398fcb793bbfc64c92235ff", + "reference": "5ff00ea2999343d42398fcb793bbfc64c92235ff", "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 +1287,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-09-14 14:14:09" + "time": "2015-11-05 09:04:44" } ], "packages-dev": [ @@ -1239,7 +1346,7 @@ }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", @@ -1340,27 +1447,26 @@ }, { "name": "pdepend/pdepend", - "version": "2.2.1", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/pdepend/pdepend.git", - "reference": "a77b6bede0afdd232155eb6f1de0b2826bcf2803" + "reference": "eceacb580af64e9039b274a1e9c6997fc69756c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/a77b6bede0afdd232155eb6f1de0b2826bcf2803", - "reference": "a77b6bede0afdd232155eb6f1de0b2826bcf2803", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/eceacb580af64e9039b274a1e9c6997fc69756c7", + "reference": "eceacb580af64e9039b274a1e9c6997fc69756c7", "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.4", + "symfony/dependency-injection": ">=2.4", + "symfony/filesystem": ">=2.4" }, "require-dev": { - "phpunit/phpunit": "^4.0.0", - "squizlabs/php_codesniffer": "^2.0.0" + "phpunit/phpunit": "4.*@stable", + "squizlabs/php_codesniffer": "@stable" }, "bin": [ "src/bin/pdepend" @@ -1376,7 +1482,7 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2015-09-24 14:17:05" + "time": "2015-09-20 20:30:27" }, { "name": "phpdocumentor/reflection-docblock", @@ -1429,16 +1535,16 @@ }, { "name": "phploc/phploc", - "version": "2.1.4", + "version": "2.1.x-dev", "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,7 +1584,7 @@ ], "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", @@ -1547,16 +1653,16 @@ }, { "name": "phpspec/prophecy", - "version": "v1.5.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" + "reference": "4f9b1eaf0a7da77c362f8d91cbc68ab1f4718d62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4f9b1eaf0a7da77c362f8d91cbc68ab1f4718d62", + "reference": "4f9b1eaf0a7da77c362f8d91cbc68ab1f4718d62", "shasum": "" }, "require": { @@ -1570,7 +1676,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.5.x-dev" } }, "autoload": { @@ -1603,11 +1709,11 @@ "spy", "stub" ], - "time": "2015-08-13 10:07:40" + "time": "2015-09-22 14:49:23" }, { "name": "phpunit/php-code-coverage", - "version": "2.2.4", + "version": "2.2.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", @@ -1669,7 +1775,7 @@ }, { "name": "phpunit/php-file-iterator", - "version": "1.4.1", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", @@ -1757,7 +1863,7 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.7", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", @@ -1798,16 +1904,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.8", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + "reference": "cab6c6fefee93d7b7c3a01292a0fe0884ea66644" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/cab6c6fefee93d7b7c3a01292a0fe0884ea66644", + "reference": "cab6c6fefee93d7b7c3a01292a0fe0884ea66644", "shasum": "" }, "require": { @@ -1843,20 +1949,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-09-15 10:49:45" + "time": "2015-09-23 14:46:55" }, { "name": "phpunit/phpunit", - "version": "4.8.13", + "version": "4.8.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "be067d6105286b74272facefc2697038f8807b77" + "reference": "6f9251d0910483fcbe22ee7a47ed604e43070770" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/be067d6105286b74272facefc2697038f8807b77", - "reference": "be067d6105286b74272facefc2697038f8807b77", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6f9251d0910483fcbe22ee7a47ed604e43070770", + "reference": "6f9251d0910483fcbe22ee7a47ed604e43070770", "shasum": "" }, "require": { @@ -1915,11 +2021,11 @@ "testing", "xunit" ], - "time": "2015-10-14 13:49:40" + "time": "2015-11-11 12:23:02" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", + "version": "2.3.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", @@ -1975,7 +2081,7 @@ }, { "name": "sebastian/comparator", - "version": "1.2.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", @@ -2039,16 +2145,16 @@ }, { "name": "sebastian/diff", - "version": "1.3.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + "reference": "6899b3e33bfbd386d88b5eea5f65f563e8793051" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/6899b3e33bfbd386d88b5eea5f65f563e8793051", + "reference": "6899b3e33bfbd386d88b5eea5f65f563e8793051", "shasum": "" }, "require": { @@ -2087,11 +2193,11 @@ "keywords": [ "diff" ], - "time": "2015-02-22 15:13:53" + "time": "2015-06-22 14:15:55" }, { "name": "sebastian/environment", - "version": "1.3.2", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", @@ -2141,16 +2247,16 @@ }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "f88f8936517d54ae6d589166810877fb2015d0a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f88f8936517d54ae6d589166810877fb2015d0a2", + "reference": "f88f8936517d54ae6d589166810877fb2015d0a2", "shasum": "" }, "require": { @@ -2158,12 +2264,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -2203,7 +2310,7 @@ "export", "exporter" ], - "time": "2015-06-21 07:55:53" + "time": "2015-08-09 04:23:41" }, { "name": "sebastian/finder-facade", @@ -2246,16 +2353,16 @@ }, { "name": "sebastian/git", - "version": "2.0.1", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/git.git", - "reference": "2d5c139d0eedcb9e67e0e9ca08023be6e9b7b47b" + "reference": "27de483134bab3db7663cd400e145b58f9edd8ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/git/zipball/2d5c139d0eedcb9e67e0e9ca08023be6e9b7b47b", - "reference": "2d5c139d0eedcb9e67e0e9ca08023be6e9b7b47b", + "url": "https://api.github.com/repos/sebastianbergmann/git/zipball/27de483134bab3db7663cd400e145b58f9edd8ec", + "reference": "27de483134bab3db7663cd400e145b58f9edd8ec", "shasum": "" }, "require": { @@ -2287,7 +2394,7 @@ "keywords": [ "git" ], - "time": "2015-04-06 16:23:43" + "time": "2015-06-30 05:13:18" }, { "name": "sebastian/global-state", @@ -2342,7 +2449,7 @@ }, { "name": "sebastian/recursion-context", - "version": "1.0.1", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", @@ -2504,29 +2611,25 @@ }, { "name": "symfony/dependency-injection", - "version": "v2.7.5", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "422c3819b110f610d79c6f1dc38af23787dc790e" + "reference": "c219ac281e5515ccd618bbe253a3cff83b98cf96" }, "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/c219ac281e5515ccd618bbe253a3cff83b98cf96", + "reference": "c219ac281e5515ccd618bbe253a3cff83b98cf96", "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 +2639,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 +2666,38 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2015-09-15 08:30:42" + "time": "2015-11-09 10:46:27" }, { "name": "symfony/finder", - "version": "v2.7.5", + "version": "2.8.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8262ab605973afbb3ef74b945daabf086f58366f" + "reference": "ead9b07af4ba77b6507bee697396a5c79e633f08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8262ab605973afbb3ef74b945daabf086f58366f", - "reference": "8262ab605973afbb3ef74b945daabf086f58366f", + "url": "https://api.github.com/repos/symfony/finder/zipball/ead9b07af4ba77b6507bee697396a5c79e633f08", + "reference": "ead9b07af4ba77b6507bee697396a5c79e633f08", "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\\Finder\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2609,7 +2715,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2015-09-19 19:59:23" + "time": "2015-10-30 20:15:42" }, { "name": "theseer/fdomdocument", @@ -2653,8 +2759,10 @@ } ], "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], + "minimum-stability": "dev", + "stability-flags": { + "mindteam/phpci-symfony2-plugin": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { From a1f5403b32faa717f0f22877ae54edd8b71a4d42 Mon Sep 17 00:00:00 2001 From: Alexander Gansky Date: Sat, 19 Dec 2015 20:11:35 +0200 Subject: [PATCH 5/5] add new plugin --- PHPCI/Plugin/SymfonyCommands.php | 78 ++++++++++++++++++++++++++++++++ local_vars.php | 42 +++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 PHPCI/Plugin/SymfonyCommands.php create mode 100644 local_vars.php diff --git a/PHPCI/Plugin/SymfonyCommands.php b/PHPCI/Plugin/SymfonyCommands.php new file mode 100644 index 00000000..6fd7d99e --- /dev/null +++ b/PHPCI/Plugin/SymfonyCommands.php @@ -0,0 +1,78 @@ + + * @license https://github.com/mindteam/phpci-symfony2-plugin/blob/master/LICENSE + * @link http://mindteam.com.ua + */ + +namespace PHPCI\Plugin; + +use PHPCI\Builder; +use PHPCI\Model\Build; +use Symfony\Component\Yaml\Parser as YamlParser; +use PHPCI\Plugin as BaseInterface; + +/** + * Plugin for Symfony2 commands + */ +class SymfonyCommands implements BaseInterface +{ + + protected $directory; + protected $phpci; + protected $build; + protected $commandList = array(); + + /** + * Set up the plugin, configure options, etc. + * + * @param Builder $phpci + * @param Build $build + * @param array $options + */ + public function __construct(Builder $phpci, Build $build, array $options = array()) + { + $this->phpci = $phpci; + $this->build = $build; + $this->directory = $phpci->buildPath; + if (isset($options['commands'])) { + $this->commandList = $options['commands']; + } + } + + /** + * Executes Symfony2 commands + * + * @return boolean plugin work status + */ + public function execute() + { + $success = true; + foreach ($this->commandList as $command) { + if (!$this->runSingleCommand($command)) { + $success = false; + break; + } + } + return $success; + } + + /** + * Run one command + * + * @param string $command command for cymfony + * + * @return boolean + */ + public function runSingleCommand($command) + { + $cmd = 'php ' . $this->directory . 'app/console '; + + return $this->phpci->executeCommand($cmd . $command, $this->directory); + } + +} diff --git a/local_vars.php b/local_vars.php new file mode 100644 index 00000000..98c07377 --- /dev/null +++ b/local_vars.php @@ -0,0 +1,42 @@ +get('phpci.url', '') . '/'); +} + +// Define PHPCI_BIN_DIR +if (!defined('PHPCI_BIN_DIR')) { + define('PHPCI_BIN_DIR', PHPCI_DIR . 'vendor/bin/'); +} + +// Define PHPCI_BUILD_ROOT_DIR +if (!defined('PHPCI_BUILD_ROOT_DIR')) { + define('PHPCI_BUILD_ROOT_DIR', PHPCI_DIR . 'PHPCI/build/'); +} + +// Should PHPCI run the Shell plugin? +if (!defined('ENABLE_SHELL_PLUGIN')) { + define('ENABLE_SHELL_PLUGIN', false); +} + +// If this is not already defined, we're not running in the console: +if (!defined('PHPCI_IS_CONSOLE')) { + define('PHPCI_IS_CONSOLE', false); +} + +if (!defined('IS_WIN')) { + define('IS_WIN', ((strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false)); +} + +// If an environment variable is set defining our config location, use that +// otherwise fall back to PHPCI/config.yml. +if (!defined('PHPCI_CONFIG_FILE')) { + define('PHPCI_CONFIG_FILE', $configFile); +}