From c6f0f8d3362926e69943c523f935791d8a9d4e3d Mon Sep 17 00:00:00 2001 From: Alejandro Glejberman Date: Sun, 29 Jan 2017 11:28:27 -0300 Subject: [PATCH 1/9] Avoid showing warning message when configuration file incomplete --- src/MageApplication.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MageApplication.php b/src/MageApplication.php index 57a8e69..1a45e29 100644 --- a/src/MageApplication.php +++ b/src/MageApplication.php @@ -71,7 +71,7 @@ class MageApplication extends Application } if (array_key_exists('magephp', $config)) { - $config = $config['magephp']; + $config = is_null($config['magephp']) ? [] : $config['magephp']; $logger = null; if (array_key_exists('log_dir', $config) && file_exists($config['log_dir']) && is_dir($config['log_dir'])) { From 092006db9187a98544fc46e55b982bb8cd89733d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sun, 29 Jan 2017 18:10:41 -0300 Subject: [PATCH 2/9] [Nostromo] Refactor config test --- src/MageApplication.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/MageApplication.php b/src/MageApplication.php index 1a45e29..91afa9c 100644 --- a/src/MageApplication.php +++ b/src/MageApplication.php @@ -70,20 +70,19 @@ class MageApplication extends Application throw new RuntimeException(sprintf('Error parsing the file "%s".', $file)); } - if (array_key_exists('magephp', $config)) { - $config = is_null($config['magephp']) ? [] : $config['magephp']; + if (array_key_exists('magephp', $config) && is_array($config['magephp'])) { $logger = null; - if (array_key_exists('log_dir', $config) && file_exists($config['log_dir']) && is_dir($config['log_dir'])) { - $logfile = sprintf('%s/%s.log', $config['log_dir'], date('Ymd_His')); - $config['log_file'] = $logfile; + if (array_key_exists('log_dir', $config['magephp']) && file_exists($config['magephp']['log_dir']) && is_dir($config['magephp']['log_dir'])) { + $logfile = sprintf('%s/%s.log', $config['magephp']['log_dir'], date('Ymd_His')); + $config['magephp']['log_file'] = $logfile; $logger = new Logger('magephp'); $logger->pushHandler(new StreamHandler($logfile)); } $this->runtime = $this->instantiateRuntime(); - $this->runtime->setConfiguration($config); + $this->runtime->setConfiguration($config['magephp']); $this->runtime->setLogger($logger); $this->loadBuiltInCommands(); From 0b2968dfa55719a033459bb2f1fe49cea110b108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sun, 29 Jan 2017 18:15:57 -0300 Subject: [PATCH 3/9] [Nostrom] Fix doc --- src/MageApplication.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MageApplication.php b/src/MageApplication.php index 91afa9c..6c9a92a 100644 --- a/src/MageApplication.php +++ b/src/MageApplication.php @@ -53,7 +53,7 @@ class MageApplication extends Application /** * Configure the Magallanes Application * - * @param $file string The YAML file from which to read the configuration + * @param string $file The YAML file from which to read the configuration * * @throws RuntimeException */ From 91da97915150417ce2c9a5b7295e6d081a168c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sun, 29 Jan 2017 18:25:02 -0300 Subject: [PATCH 4/9] [Nostromo] Refactor config --- bin/mage | 4 +- src/MageApplication.php | 22 +++++----- .../BuiltIn/Config/DumpCommandTest.php | 4 +- .../Config/EnvironmentsCommandTest.php | 4 +- .../BuiltIn/DeployCommandMiscTasksTest.php | 24 +++++------ .../Command/BuiltIn/DeployCommandMiscTest.php | 28 ++++++------- .../BuiltIn/DeployCommandWithReleasesTest.php | 40 +++++++++---------- .../DeployCommandWithoutReleasesTest.php | 8 ++-- .../BuiltIn/Releases/ListCommandTest.php | 28 ++++++------- .../BuiltIn/Releases/RollbackCommandTest.php | 16 ++++---- tests/Command/BuiltIn/VersionCommandTest.php | 4 +- tests/MageApplicationTest.php | 20 +++++----- 12 files changed, 103 insertions(+), 99 deletions(-) diff --git a/bin/mage b/bin/mage index 26cd158..3d1b6ca 100755 --- a/bin/mage +++ b/bin/mage @@ -11,8 +11,8 @@ if (file_exists(__DIR__ . '/../../../autoload.php')) { use Mage\MageApplication; try { - $mage = new MageApplication(); - $mage->configure('.mage.yml'); + $mage = new MageApplication('.mage.yml'); + $mage->configure(); $mage->run(); } catch (Exception $exception) { printf('Error: %s' . PHP_EOL, $exception->getMessage()); diff --git a/src/MageApplication.php b/src/MageApplication.php index 6c9a92a..acbdc47 100644 --- a/src/MageApplication.php +++ b/src/MageApplication.php @@ -33,9 +33,15 @@ use Mage\Runtime\Exception\RuntimeException; class MageApplication extends Application { protected $runtime; + protected $file; - public function __construct() + /** + * @param string $file The YAML file from which to read the configuration + */ + public function __construct($file) { + $this->file = $file; + $dispatcher = new EventDispatcher(); $dispatcher->addListener(ConsoleEvents::EXCEPTION, function (ConsoleExceptionEvent $event) { @@ -53,21 +59,19 @@ class MageApplication extends Application /** * Configure the Magallanes Application * - * @param string $file The YAML file from which to read the configuration - * * @throws RuntimeException */ - public function configure($file) + public function configure() { - if (!file_exists($file) || !is_readable($file)) { - throw new RuntimeException(sprintf('The file "%s" does not exists or is not readable.', $file)); + if (!file_exists($this->file) || !is_readable($this->file)) { + throw new RuntimeException(sprintf('The file "%s" does not exists or is not readable.', $this->file)); } try { $parser = new Parser(); - $config = $parser->parse(file_get_contents($file)); + $config = $parser->parse(file_get_contents($this->file)); } catch (ParseException $exception) { - throw new RuntimeException(sprintf('Error parsing the file "%s".', $file)); + throw new RuntimeException(sprintf('Error parsing the file "%s".', $this->file)); } if (array_key_exists('magephp', $config) && is_array($config['magephp'])) { @@ -89,7 +93,7 @@ class MageApplication extends Application return true; } - throw new RuntimeException(sprintf('The file "%s" does not have a valid Magallanes configuration.', $file)); + throw new RuntimeException(sprintf('The file "%s" does not have a valid Magallanes configuration.', $this->file)); } /** diff --git a/tests/Command/BuiltIn/Config/DumpCommandTest.php b/tests/Command/BuiltIn/Config/DumpCommandTest.php index f7ad66e..7723ec4 100644 --- a/tests/Command/BuiltIn/Config/DumpCommandTest.php +++ b/tests/Command/BuiltIn/Config/DumpCommandTest.php @@ -20,8 +20,8 @@ class DumpCommandTest extends TestCase { public function testConfigDumpTermination() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/basic.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/basic.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('config:dump'); diff --git a/tests/Command/BuiltIn/Config/EnvironmentsCommandTest.php b/tests/Command/BuiltIn/Config/EnvironmentsCommandTest.php index 79f78ae..f8e6995 100644 --- a/tests/Command/BuiltIn/Config/EnvironmentsCommandTest.php +++ b/tests/Command/BuiltIn/Config/EnvironmentsCommandTest.php @@ -20,8 +20,8 @@ class EnvironmentsCommandTest extends TestCase { public function testConfigDumpTermination() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/basic.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/basic.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('config:environments'); diff --git a/tests/Command/BuiltIn/DeployCommandMiscTasksTest.php b/tests/Command/BuiltIn/DeployCommandMiscTasksTest.php index c813e21..1aaf87e 100644 --- a/tests/Command/BuiltIn/DeployCommandMiscTasksTest.php +++ b/tests/Command/BuiltIn/DeployCommandMiscTasksTest.php @@ -20,8 +20,8 @@ class DeployCommandMiscTasksTest extends TestCase { public function testSymfonyEnvironmentConfiguration() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/symfony-envconf.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/symfony-envconf.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -53,8 +53,8 @@ class DeployCommandMiscTasksTest extends TestCase public function testComposerFlags() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/composer.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/composer.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -84,8 +84,8 @@ class DeployCommandMiscTasksTest extends TestCase public function testInvalidTaskName() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/invalid-task.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/invalid-task.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -100,8 +100,8 @@ class DeployCommandMiscTasksTest extends TestCase public function testBrokenGitBranch() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/broken-git-branch.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/broken-git-branch.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -119,8 +119,8 @@ class DeployCommandMiscTasksTest extends TestCase public function testBrokenGitCheckout() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/broken-git-branch.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/broken-git-branch.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -138,8 +138,8 @@ class DeployCommandMiscTasksTest extends TestCase public function testBrokenGitUpdate() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/broken-git-branch.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/broken-git-branch.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); diff --git a/tests/Command/BuiltIn/DeployCommandMiscTest.php b/tests/Command/BuiltIn/DeployCommandMiscTest.php index 02b3d3a..c459886 100644 --- a/tests/Command/BuiltIn/DeployCommandMiscTest.php +++ b/tests/Command/BuiltIn/DeployCommandMiscTest.php @@ -20,8 +20,8 @@ class DeployCommandMiscTest extends TestCase { public function testDeploymentWithNoHosts() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/no-hosts.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/no-hosts.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -39,8 +39,8 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithSudo() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-sudo.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-sudo.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -78,8 +78,8 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithBranchOverwrite() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-without-releases.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-without-releases.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -116,8 +116,8 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithCustomTask() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-custom-task.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-custom-task.yml'); + $application->configure(); /** @var AbstractCommand $command */ @@ -150,8 +150,8 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithErrorTaskCommands() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-with-error.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-with-error.yml'); + $application->configure(); $application->getRuntime()->setReleaseId('20170101015120'); @@ -192,8 +192,8 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithFailingPostDeployTaskCommands() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-with-postdeploy-error.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-with-postdeploy-error.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -228,8 +228,8 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithSkippingTask() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-skipping.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-skipping.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); diff --git a/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php b/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php index 554c56d..57747f3 100644 --- a/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php +++ b/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php @@ -20,8 +20,8 @@ class DeployCommandWithReleasesTest extends TestCase { public function testDeploymentWithReleasesCommands() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml'); + $application->configure(); $application->getRuntime()->setReleaseId('20170101015120'); @@ -71,8 +71,8 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentWithoutReleasesTarPrepare() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-force-tar1.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-force-tar1.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -87,8 +87,8 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentWithoutReleasesTarCopy() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-force-tar2.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-force-tar2.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -103,8 +103,8 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentWithoutReleasesTarCleanup() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-force-tar3.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-force-tar3.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -119,8 +119,8 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentFailCopyCommands() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-fail-copy-tar.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-fail-copy-tar.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -135,8 +135,8 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentWithoutReleasesForceRelease() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-force-release.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-force-release.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -151,8 +151,8 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentFailToExtract() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml'); + $application->configure(); $application->getRuntime()->setReleaseId('20170101015120'); @@ -194,8 +194,8 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentFailToCopy() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml'); + $application->configure(); $application->getRuntime()->setReleaseId('20170101015120'); @@ -236,8 +236,8 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentFailCleanup() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml'); + $application->configure(); $application->getRuntime()->setReleaseId('20170101015120'); @@ -290,8 +290,8 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentFailMidway() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml'); + $application->configure(); $application->getRuntime()->setReleaseId('20170101015120'); diff --git a/tests/Command/BuiltIn/DeployCommandWithoutReleasesTest.php b/tests/Command/BuiltIn/DeployCommandWithoutReleasesTest.php index 446f6ab..aa8d8f2 100644 --- a/tests/Command/BuiltIn/DeployCommandWithoutReleasesTest.php +++ b/tests/Command/BuiltIn/DeployCommandWithoutReleasesTest.php @@ -20,8 +20,8 @@ class DeployCommandWithoutReleasesTest extends TestCase { public function testDeploymentWithoutReleasesCommands() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-without-releases.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-without-releases.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -58,8 +58,8 @@ class DeployCommandWithoutReleasesTest extends TestCase public function testDeploymentFailMidway() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/testhost-without-releases.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-without-releases.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); diff --git a/tests/Command/BuiltIn/Releases/ListCommandTest.php b/tests/Command/BuiltIn/Releases/ListCommandTest.php index f340b98..99eb5d9 100644 --- a/tests/Command/BuiltIn/Releases/ListCommandTest.php +++ b/tests/Command/BuiltIn/Releases/ListCommandTest.php @@ -20,8 +20,8 @@ class ListCommandTest extends TestCase { public function testListReleasesCommands() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/testhost.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); @@ -48,8 +48,8 @@ class ListCommandTest extends TestCase public function testListReleasesWithInvalidEnvironment() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/testhost.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); @@ -64,8 +64,8 @@ class ListCommandTest extends TestCase public function testListReleasesWithoutReleases() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/testhost-without-releases.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-without-releases.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); @@ -80,8 +80,8 @@ class ListCommandTest extends TestCase public function testFailToGetCurrentRelease() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/testhost-fail-get-current.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-fail-get-current.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); @@ -96,8 +96,8 @@ class ListCommandTest extends TestCase public function testNoReleasesAvailable() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/testhost-no-releases.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-no-releases.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); @@ -111,8 +111,8 @@ class ListCommandTest extends TestCase public function testFailGetReleases() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/testhost-fail-get-releases.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-fail-get-releases.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); @@ -127,8 +127,8 @@ class ListCommandTest extends TestCase public function testNoHosts() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/testhost-no-hosts.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-no-hosts.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); diff --git a/tests/Command/BuiltIn/Releases/RollbackCommandTest.php b/tests/Command/BuiltIn/Releases/RollbackCommandTest.php index 1218adc..1e34aaf 100644 --- a/tests/Command/BuiltIn/Releases/RollbackCommandTest.php +++ b/tests/Command/BuiltIn/Releases/RollbackCommandTest.php @@ -20,8 +20,8 @@ class RollbackCommandTest extends TestCase { public function testRollbackReleaseCommands() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/testhost.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:rollback'); @@ -48,8 +48,8 @@ class RollbackCommandTest extends TestCase public function testRollbackReleaseWithInvalidEnvironment() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/testhost.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:rollback'); @@ -64,8 +64,8 @@ class RollbackCommandTest extends TestCase public function testRollbackReleaseWithoutReleases() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/testhost-without-releases.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-without-releases.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:rollback'); @@ -80,8 +80,8 @@ class RollbackCommandTest extends TestCase public function testRollbackReleaseNotAvailable() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../../Resources/testhost-not-have-release.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-not-have-release.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:rollback'); diff --git a/tests/Command/BuiltIn/VersionCommandTest.php b/tests/Command/BuiltIn/VersionCommandTest.php index 2e39690..feb2af8 100644 --- a/tests/Command/BuiltIn/VersionCommandTest.php +++ b/tests/Command/BuiltIn/VersionCommandTest.php @@ -21,8 +21,8 @@ class VersionCommandTest extends TestCase { public function testVersionOutput() { - $application = new MageApplicationMockup(); - $application->configure(__DIR__ . '/../../Resources/basic.yml'); + $application = new MageApplicationMockup(__DIR__ . '/../../Resources/basic.yml'); + $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('version'); diff --git a/tests/MageApplicationTest.php b/tests/MageApplicationTest.php index 265b5e9..02af709 100644 --- a/tests/MageApplicationTest.php +++ b/tests/MageApplicationTest.php @@ -20,16 +20,16 @@ class MageApplicationTest extends TestCase { public function testValidConfiguration() { - $application = new MageApplication(); - $application->configure(__DIR__ . '/Resources/basic.yml'); + $application = new MageApplication(__DIR__ . '/Resources/basic.yml'); + $application->configure(); $this->assertTrue($application instanceof MageApplication); } public function testInValidConfiguration() { try { - $application = new MageApplication(); - $application->configure(__DIR__ . '/Resources/invalid.yml'); + $application = new MageApplication(__DIR__ . '/Resources/invalid.yml'); + $application->configure(); } catch (Exception $exception) { $this->assertTrue($exception instanceof RuntimeException); $this->assertEquals(sprintf('The file "%s" does not have a valid Magallanes configuration.', __DIR__ . '/Resources/invalid.yml'), $exception->getMessage()); @@ -39,8 +39,8 @@ class MageApplicationTest extends TestCase public function testParserError() { try { - $application = new MageApplication(); - $application->configure(__DIR__ . '/Resources/invalid-yaml.yml'); + $application = new MageApplication(__DIR__ . '/Resources/invalid-yaml.yml'); + $application->configure(); } catch (Exception $exception) { $this->assertTrue($exception instanceof RuntimeException); $this->assertEquals(sprintf('Error parsing the file "%s".', __DIR__ . '/Resources/invalid-yaml.yml'), $exception->getMessage()); @@ -50,8 +50,8 @@ class MageApplicationTest extends TestCase public function testInvalidFile() { try { - $application = new MageApplication(); - $application->configure(__DIR__ . '/Resources/this-does-not-exists.yml'); + $application = new MageApplication(__DIR__ . '/Resources/this-does-not-exists.yml'); + $application->configure(); } catch (Exception $exception) { $this->assertTrue($exception instanceof RuntimeException); $this->assertEquals(sprintf('The file "%s" does not exists or is not readable.', __DIR__ . '/Resources/this-does-not-exists.yml'), $exception->getMessage()); @@ -60,9 +60,9 @@ class MageApplicationTest extends TestCase public function testAppDispatcher() { - $application = new MageApplication(); + $application = new MageApplication(__DIR__ . '/Resources/basic.yml'); $application->setAutoExit(false); - $application->configure(__DIR__ . '/Resources/basic.yml'); + $application->configure(); $this->assertTrue($application instanceof MageApplication); $application->register('foo')->setCode(function () { From 0bae8e2b1beb0e41e1f488180037e07a65a78edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sun, 29 Jan 2017 19:25:03 -0300 Subject: [PATCH 5/9] [Nostromo] Refactor config load --- bin/mage | 1 - src/Command/AbstractCommand.php | 8 ++++++++ src/Command/BuiltIn/Config/DumpCommand.php | 2 ++ src/Command/BuiltIn/Config/EnvironmentsCommand.php | 2 ++ src/Command/BuiltIn/DeployCommand.php | 2 ++ src/Command/BuiltIn/Releases/ListCommand.php | 2 ++ src/Command/BuiltIn/Releases/RollbackCommand.php | 2 ++ src/MageApplication.php | 13 ++++++------- tests/Command/BuiltIn/Config/DumpCommandTest.php | 1 - .../BuiltIn/Config/EnvironmentsCommandTest.php | 1 - .../Command/BuiltIn/DeployCommandMiscTasksTest.php | 6 ------ tests/Command/BuiltIn/DeployCommandMiscTest.php | 8 -------- .../BuiltIn/DeployCommandWithReleasesTest.php | 10 ---------- .../BuiltIn/DeployCommandWithoutReleasesTest.php | 2 -- tests/Command/BuiltIn/Releases/ListCommandTest.php | 7 ------- .../BuiltIn/Releases/RollbackCommandTest.php | 4 ---- tests/Command/BuiltIn/VersionCommandTest.php | 1 - tests/MageApplicationTest.php | 5 ----- 18 files changed, 24 insertions(+), 53 deletions(-) diff --git a/bin/mage b/bin/mage index 3d1b6ca..3175025 100755 --- a/bin/mage +++ b/bin/mage @@ -12,7 +12,6 @@ use Mage\MageApplication; try { $mage = new MageApplication('.mage.yml'); - $mage->configure(); $mage->run(); } catch (Exception $exception) { printf('Error: %s' . PHP_EOL, $exception->getMessage()); diff --git a/src/Command/AbstractCommand.php b/src/Command/AbstractCommand.php index d26584e..9fa2f90 100644 --- a/src/Command/AbstractCommand.php +++ b/src/Command/AbstractCommand.php @@ -66,4 +66,12 @@ abstract class AbstractCommand extends Command $utils = new Utils(); return $utils->getStageName($this->runtime->getStage()); } + + /** + * Requires the configuration to be loaded + */ + protected function requireConfig() + { + $this->getApplication()->configure(); + } } diff --git a/src/Command/BuiltIn/Config/DumpCommand.php b/src/Command/BuiltIn/Config/DumpCommand.php index d5dfc56..8b7a185 100644 --- a/src/Command/BuiltIn/Config/DumpCommand.php +++ b/src/Command/BuiltIn/Config/DumpCommand.php @@ -41,6 +41,8 @@ class DumpCommand extends AbstractCommand */ protected function execute(InputInterface $input, OutputInterface $output) { + $this->requireConfig(); + $output->writeln('Starting Magallanes'); $output->writeln(''); diff --git a/src/Command/BuiltIn/Config/EnvironmentsCommand.php b/src/Command/BuiltIn/Config/EnvironmentsCommand.php index 566f83e..b66616b 100644 --- a/src/Command/BuiltIn/Config/EnvironmentsCommand.php +++ b/src/Command/BuiltIn/Config/EnvironmentsCommand.php @@ -42,6 +42,8 @@ class EnvironmentsCommand extends AbstractCommand */ protected function execute(InputInterface $input, OutputInterface $output) { + $this->requireConfig(); + $output->writeln('Starting Magallanes'); $output->writeln(''); diff --git a/src/Command/BuiltIn/DeployCommand.php b/src/Command/BuiltIn/DeployCommand.php index c932463..dd86e4d 100644 --- a/src/Command/BuiltIn/DeployCommand.php +++ b/src/Command/BuiltIn/DeployCommand.php @@ -58,6 +58,8 @@ class DeployCommand extends AbstractCommand */ protected function execute(InputInterface $input, OutputInterface $output) { + $this->requireConfig(); + $output->writeln('Starting Magallanes'); $output->writeln(''); diff --git a/src/Command/BuiltIn/Releases/ListCommand.php b/src/Command/BuiltIn/Releases/ListCommand.php index 5c034c9..4bee690 100644 --- a/src/Command/BuiltIn/Releases/ListCommand.php +++ b/src/Command/BuiltIn/Releases/ListCommand.php @@ -51,6 +51,8 @@ class ListCommand extends AbstractCommand */ protected function execute(InputInterface $input, OutputInterface $output) { + $this->requireConfig(); + $utils = new Utils(); $output->writeln('Starting Magallanes'); $output->writeln(''); diff --git a/src/Command/BuiltIn/Releases/RollbackCommand.php b/src/Command/BuiltIn/Releases/RollbackCommand.php index 794ad5d..c5d1a9b 100644 --- a/src/Command/BuiltIn/Releases/RollbackCommand.php +++ b/src/Command/BuiltIn/Releases/RollbackCommand.php @@ -52,6 +52,8 @@ class RollbackCommand extends DeployCommand */ protected function execute(InputInterface $input, OutputInterface $output) { + $this->requireConfig(); + $output->writeln('Starting Magallanes'); $output->writeln(''); diff --git a/src/MageApplication.php b/src/MageApplication.php index acbdc47..70b144c 100644 --- a/src/MageApplication.php +++ b/src/MageApplication.php @@ -40,9 +40,11 @@ class MageApplication extends Application */ public function __construct($file) { - $this->file = $file; + parent::__construct('Magallanes', Mage::VERSION); + $this->file = $file; $dispatcher = new EventDispatcher(); + $this->setDispatcher($dispatcher); $dispatcher->addListener(ConsoleEvents::EXCEPTION, function (ConsoleExceptionEvent $event) { $output = $event->getOutput(); @@ -52,8 +54,8 @@ class MageApplication extends Application $event->setException(new \LogicException('Caught exception', $exitCode, $event->getException())); }); - $this->setDispatcher($dispatcher); - parent::__construct('Magallanes', Mage::VERSION); + $this->runtime = $this->instantiateRuntime(); + $this->loadBuiltInCommands(); } /** @@ -85,12 +87,9 @@ class MageApplication extends Application $logger->pushHandler(new StreamHandler($logfile)); } - $this->runtime = $this->instantiateRuntime(); $this->runtime->setConfiguration($config['magephp']); $this->runtime->setLogger($logger); - - $this->loadBuiltInCommands(); - return true; + return; } throw new RuntimeException(sprintf('The file "%s" does not have a valid Magallanes configuration.', $this->file)); diff --git a/tests/Command/BuiltIn/Config/DumpCommandTest.php b/tests/Command/BuiltIn/Config/DumpCommandTest.php index 7723ec4..4eb25a9 100644 --- a/tests/Command/BuiltIn/Config/DumpCommandTest.php +++ b/tests/Command/BuiltIn/Config/DumpCommandTest.php @@ -21,7 +21,6 @@ class DumpCommandTest extends TestCase public function testConfigDumpTermination() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/basic.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('config:dump'); diff --git a/tests/Command/BuiltIn/Config/EnvironmentsCommandTest.php b/tests/Command/BuiltIn/Config/EnvironmentsCommandTest.php index f8e6995..58a6600 100644 --- a/tests/Command/BuiltIn/Config/EnvironmentsCommandTest.php +++ b/tests/Command/BuiltIn/Config/EnvironmentsCommandTest.php @@ -21,7 +21,6 @@ class EnvironmentsCommandTest extends TestCase public function testConfigDumpTermination() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/basic.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('config:environments'); diff --git a/tests/Command/BuiltIn/DeployCommandMiscTasksTest.php b/tests/Command/BuiltIn/DeployCommandMiscTasksTest.php index 1aaf87e..4d5efd6 100644 --- a/tests/Command/BuiltIn/DeployCommandMiscTasksTest.php +++ b/tests/Command/BuiltIn/DeployCommandMiscTasksTest.php @@ -21,7 +21,6 @@ class DeployCommandMiscTasksTest extends TestCase public function testSymfonyEnvironmentConfiguration() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/symfony-envconf.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -54,7 +53,6 @@ class DeployCommandMiscTasksTest extends TestCase public function testComposerFlags() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/composer.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -85,7 +83,6 @@ class DeployCommandMiscTasksTest extends TestCase public function testInvalidTaskName() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/invalid-task.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -101,7 +98,6 @@ class DeployCommandMiscTasksTest extends TestCase public function testBrokenGitBranch() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/broken-git-branch.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -120,7 +116,6 @@ class DeployCommandMiscTasksTest extends TestCase public function testBrokenGitCheckout() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/broken-git-branch.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -139,7 +134,6 @@ class DeployCommandMiscTasksTest extends TestCase public function testBrokenGitUpdate() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/broken-git-branch.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); diff --git a/tests/Command/BuiltIn/DeployCommandMiscTest.php b/tests/Command/BuiltIn/DeployCommandMiscTest.php index c459886..24dfdb8 100644 --- a/tests/Command/BuiltIn/DeployCommandMiscTest.php +++ b/tests/Command/BuiltIn/DeployCommandMiscTest.php @@ -21,7 +21,6 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithNoHosts() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/no-hosts.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -40,7 +39,6 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithSudo() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-sudo.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -79,7 +77,6 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithBranchOverwrite() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-without-releases.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -117,8 +114,6 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithCustomTask() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-custom-task.yml'); - $application->configure(); - /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -151,7 +146,6 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithErrorTaskCommands() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-with-error.yml'); - $application->configure(); $application->getRuntime()->setReleaseId('20170101015120'); @@ -193,7 +187,6 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithFailingPostDeployTaskCommands() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-with-postdeploy-error.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -229,7 +222,6 @@ class DeployCommandMiscTest extends TestCase public function testDeploymentWithSkippingTask() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-skipping.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); diff --git a/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php b/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php index 57747f3..fdcdece 100644 --- a/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php +++ b/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php @@ -21,7 +21,6 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentWithReleasesCommands() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml'); - $application->configure(); $application->getRuntime()->setReleaseId('20170101015120'); @@ -72,7 +71,6 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentWithoutReleasesTarPrepare() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-force-tar1.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -88,7 +86,6 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentWithoutReleasesTarCopy() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-force-tar2.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -104,7 +101,6 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentWithoutReleasesTarCleanup() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-force-tar3.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -120,7 +116,6 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentFailCopyCommands() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-fail-copy-tar.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -136,7 +131,6 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentWithoutReleasesForceRelease() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-force-release.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -152,7 +146,6 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentFailToExtract() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml'); - $application->configure(); $application->getRuntime()->setReleaseId('20170101015120'); @@ -195,7 +188,6 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentFailToCopy() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml'); - $application->configure(); $application->getRuntime()->setReleaseId('20170101015120'); @@ -237,7 +229,6 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentFailCleanup() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml'); - $application->configure(); $application->getRuntime()->setReleaseId('20170101015120'); @@ -291,7 +282,6 @@ class DeployCommandWithReleasesTest extends TestCase public function testDeploymentFailMidway() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml'); - $application->configure(); $application->getRuntime()->setReleaseId('20170101015120'); diff --git a/tests/Command/BuiltIn/DeployCommandWithoutReleasesTest.php b/tests/Command/BuiltIn/DeployCommandWithoutReleasesTest.php index aa8d8f2..e4b7fd3 100644 --- a/tests/Command/BuiltIn/DeployCommandWithoutReleasesTest.php +++ b/tests/Command/BuiltIn/DeployCommandWithoutReleasesTest.php @@ -21,7 +21,6 @@ class DeployCommandWithoutReleasesTest extends TestCase public function testDeploymentWithoutReleasesCommands() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-without-releases.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); @@ -59,7 +58,6 @@ class DeployCommandWithoutReleasesTest extends TestCase public function testDeploymentFailMidway() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-without-releases.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('deploy'); diff --git a/tests/Command/BuiltIn/Releases/ListCommandTest.php b/tests/Command/BuiltIn/Releases/ListCommandTest.php index 99eb5d9..a37d802 100644 --- a/tests/Command/BuiltIn/Releases/ListCommandTest.php +++ b/tests/Command/BuiltIn/Releases/ListCommandTest.php @@ -21,7 +21,6 @@ class ListCommandTest extends TestCase public function testListReleasesCommands() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); @@ -49,7 +48,6 @@ class ListCommandTest extends TestCase public function testListReleasesWithInvalidEnvironment() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); @@ -65,7 +63,6 @@ class ListCommandTest extends TestCase public function testListReleasesWithoutReleases() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-without-releases.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); @@ -81,7 +78,6 @@ class ListCommandTest extends TestCase public function testFailToGetCurrentRelease() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-fail-get-current.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); @@ -97,7 +93,6 @@ class ListCommandTest extends TestCase public function testNoReleasesAvailable() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-no-releases.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); @@ -112,7 +107,6 @@ class ListCommandTest extends TestCase public function testFailGetReleases() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-fail-get-releases.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); @@ -128,7 +122,6 @@ class ListCommandTest extends TestCase public function testNoHosts() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-no-hosts.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:list'); diff --git a/tests/Command/BuiltIn/Releases/RollbackCommandTest.php b/tests/Command/BuiltIn/Releases/RollbackCommandTest.php index 1e34aaf..30bbebb 100644 --- a/tests/Command/BuiltIn/Releases/RollbackCommandTest.php +++ b/tests/Command/BuiltIn/Releases/RollbackCommandTest.php @@ -21,7 +21,6 @@ class RollbackCommandTest extends TestCase public function testRollbackReleaseCommands() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:rollback'); @@ -49,7 +48,6 @@ class RollbackCommandTest extends TestCase public function testRollbackReleaseWithInvalidEnvironment() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:rollback'); @@ -65,7 +63,6 @@ class RollbackCommandTest extends TestCase public function testRollbackReleaseWithoutReleases() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-without-releases.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:rollback'); @@ -81,7 +78,6 @@ class RollbackCommandTest extends TestCase public function testRollbackReleaseNotAvailable() { $application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-not-have-release.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('releases:rollback'); diff --git a/tests/Command/BuiltIn/VersionCommandTest.php b/tests/Command/BuiltIn/VersionCommandTest.php index feb2af8..2f83891 100644 --- a/tests/Command/BuiltIn/VersionCommandTest.php +++ b/tests/Command/BuiltIn/VersionCommandTest.php @@ -22,7 +22,6 @@ class VersionCommandTest extends TestCase public function testVersionOutput() { $application = new MageApplicationMockup(__DIR__ . '/../../Resources/basic.yml'); - $application->configure(); /** @var AbstractCommand $command */ $command = $application->find('version'); diff --git a/tests/MageApplicationTest.php b/tests/MageApplicationTest.php index 02af709..c3f2705 100644 --- a/tests/MageApplicationTest.php +++ b/tests/MageApplicationTest.php @@ -21,7 +21,6 @@ class MageApplicationTest extends TestCase public function testValidConfiguration() { $application = new MageApplication(__DIR__ . '/Resources/basic.yml'); - $application->configure(); $this->assertTrue($application instanceof MageApplication); } @@ -29,7 +28,6 @@ class MageApplicationTest extends TestCase { try { $application = new MageApplication(__DIR__ . '/Resources/invalid.yml'); - $application->configure(); } catch (Exception $exception) { $this->assertTrue($exception instanceof RuntimeException); $this->assertEquals(sprintf('The file "%s" does not have a valid Magallanes configuration.', __DIR__ . '/Resources/invalid.yml'), $exception->getMessage()); @@ -40,7 +38,6 @@ class MageApplicationTest extends TestCase { try { $application = new MageApplication(__DIR__ . '/Resources/invalid-yaml.yml'); - $application->configure(); } catch (Exception $exception) { $this->assertTrue($exception instanceof RuntimeException); $this->assertEquals(sprintf('Error parsing the file "%s".', __DIR__ . '/Resources/invalid-yaml.yml'), $exception->getMessage()); @@ -51,7 +48,6 @@ class MageApplicationTest extends TestCase { try { $application = new MageApplication(__DIR__ . '/Resources/this-does-not-exists.yml'); - $application->configure(); } catch (Exception $exception) { $this->assertTrue($exception instanceof RuntimeException); $this->assertEquals(sprintf('The file "%s" does not exists or is not readable.', __DIR__ . '/Resources/this-does-not-exists.yml'), $exception->getMessage()); @@ -62,7 +58,6 @@ class MageApplicationTest extends TestCase { $application = new MageApplication(__DIR__ . '/Resources/basic.yml'); $application->setAutoExit(false); - $application->configure(); $this->assertTrue($application instanceof MageApplication); $application->register('foo')->setCode(function () { From a3cbe97ac10ac0ddea7f3e65054d6d4b111ee16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sun, 29 Jan 2017 19:32:08 -0300 Subject: [PATCH 6/9] [Nostromo] Issuws with Tar and large filenames --- src/Task/BuiltIn/Deploy/Tar/PrepareTask.php | 2 +- tests/Command/BuiltIn/DeployCommandMiscTest.php | 2 +- .../Command/BuiltIn/DeployCommandWithReleasesTest.php | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Task/BuiltIn/Deploy/Tar/PrepareTask.php b/src/Task/BuiltIn/Deploy/Tar/PrepareTask.php index d6f04b1..d3b9d28 100644 --- a/src/Task/BuiltIn/Deploy/Tar/PrepareTask.php +++ b/src/Task/BuiltIn/Deploy/Tar/PrepareTask.php @@ -41,7 +41,7 @@ class PrepareTask extends AbstractTask $this->runtime->setVar('tar_local', $tarLocal); $excludes = $this->getExcludes(); - $flags = $this->runtime->getEnvOption('tar_create', 'cfzop'); + $flags = $this->runtime->getEnvOption('tar_create', 'cfzp'); $cmdTar = sprintf('tar %s %s %s ./', $flags, $tarLocal, $excludes); /** @var Process $process */ diff --git a/tests/Command/BuiltIn/DeployCommandMiscTest.php b/tests/Command/BuiltIn/DeployCommandMiscTest.php index 24dfdb8..334c8e1 100644 --- a/tests/Command/BuiltIn/DeployCommandMiscTest.php +++ b/tests/Command/BuiltIn/DeployCommandMiscTest.php @@ -164,7 +164,7 @@ class DeployCommandMiscTest extends TestCase 2 => 'git pull', 3 => 'composer install --optimize-autoloader', 4 => 'composer dump-autoload --optimize', - 5 => 'tar cfzop /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./', + 5 => 'tar cfzp /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./', 6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"mkdir -p /var/www/test/releases/1234567890\\"', 7 => 'scp -P 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /tmp/mageXYZ tester@testhost:/var/www/test/releases/1234567890/mageXYZ', 8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test/releases/1234567890 \\&\\& tar xfzop mageXYZ\\"', diff --git a/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php b/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php index fdcdece..9273a52 100644 --- a/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php +++ b/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php @@ -39,7 +39,7 @@ class DeployCommandWithReleasesTest extends TestCase 2 => 'git pull', 3 => 'composer install --optimize-autoloader', 4 => 'composer dump-autoload --optimize', - 5 => 'tar cfzop /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./', + 5 => 'tar cfzp /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./', 6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"mkdir -p /var/www/test/releases/1234567890\\"', 7 => 'scp -P 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /tmp/mageXYZ tester@testhost:/var/www/test/releases/1234567890/mageXYZ', 8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test/releases/1234567890 \\&\\& tar xfzop mageXYZ\\"', @@ -166,7 +166,7 @@ class DeployCommandWithReleasesTest extends TestCase 2 => 'git pull', 3 => 'composer install --optimize-autoloader', 4 => 'composer dump-autoload --optimize', - 5 => 'tar cfzop /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./', + 5 => 'tar cfzp /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./', 6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"mkdir -p /var/www/test/releases/1234567890\\"', 7 => 'scp -P 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /tmp/mageXYZ tester@testhost:/var/www/test/releases/1234567890/mageXYZ', 8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test/releases/1234567890 \\&\\& tar xfzop mageXYZ\\"', @@ -208,7 +208,7 @@ class DeployCommandWithReleasesTest extends TestCase 2 => 'git pull', 3 => 'composer install --optimize-autoloader', 4 => 'composer dump-autoload --optimize', - 5 => 'tar cfzop /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./', + 5 => 'tar cfzp /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./', 6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"mkdir -p /var/www/test/releases/1234567890\\"', 7 => 'scp -P 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /tmp/mageXYZ tester@testhost:/var/www/test/releases/1234567890/mageXYZ', ); @@ -249,7 +249,7 @@ class DeployCommandWithReleasesTest extends TestCase 2 => 'git pull', 3 => 'composer install --optimize-autoloader', 4 => 'composer dump-autoload --optimize', - 5 => 'tar cfzop /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./', + 5 => 'tar cfzp /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./', 6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"mkdir -p /var/www/test/releases/1234567890\\"', 7 => 'scp -P 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /tmp/mageXYZ tester@testhost:/var/www/test/releases/1234567890/mageXYZ', 8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test/releases/1234567890 \\&\\& tar xfzop mageXYZ\\"', @@ -302,7 +302,7 @@ class DeployCommandWithReleasesTest extends TestCase 2 => 'git pull', 3 => 'composer install --optimize-autoloader', 4 => 'composer dump-autoload --optimize', - 5 => 'tar cfzop /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./', + 5 => 'tar cfzp /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./', 6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"mkdir -p /var/www/test/releases/1234567890\\"', 7 => 'scp -P 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /tmp/mageXYZ tester@testhost:/var/www/test/releases/1234567890/mageXYZ', 8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test/releases/1234567890 \\&\\& tar xfzop mageXYZ\\"', From 8a417d724657b49e60096a0b9b440fa291b7496a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sun, 29 Jan 2017 19:32:52 -0300 Subject: [PATCH 7/9] [Nostromo] Do not force a composer.lock --- .gitignore | 1 + composer.lock | 1899 ------------------------------------------------- 2 files changed, 1 insertion(+), 1899 deletions(-) delete mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index d5a5bd7..263233c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /vendor/ /build +composer.lock diff --git a/composer.lock b/composer.lock deleted file mode 100644 index c827c9a..0000000 --- a/composer.lock +++ /dev/null @@ -1,1899 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "d9ca16d331cb81c45675d3905de30974", - "packages": [ - { - "name": "monolog/monolog", - "version": "1.22.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bad29cb8d18ab0315e6c477751418a82c850d558", - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "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", - "ruflin/elastica": ">=0.90 <3.0", - "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "~5.3" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "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", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "sentry/sentry": "Allow sending log messages to a Sentry server" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "time": "2016-11-26T00:15:39+00:00" - }, - { - "name": "psr/log", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2016-10-10T12:19:37+00:00" - }, - { - "name": "symfony/console", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "d12aa9ca20f4db83ec58410978dab6afcb9d6aaa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d12aa9ca20f4db83ec58410978dab6afcb9d6aaa", - "reference": "d12aa9ca20f4db83ec58410978dab6afcb9d6aaa", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/debug": "~2.8|~3.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/filesystem": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2016-12-11T14:34:22+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/9f923e68d524a3095c5a2ae5fc7220c7cbc12231", - "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/class-loader": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2016-11-16T22:18:16+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "e8f47a327c2f0fd5aa04fa60af2b693006ed7283" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e8f47a327c2f0fd5aa04fa60af2b693006ed7283", - "reference": "e8f47a327c2f0fd5aa04fa60af2b693006ed7283", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2016-10-13T06:29:04+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "8d4cf7561a5b17e5eb7a02b80d0b8f014a3796d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/8d4cf7561a5b17e5eb7a02b80d0b8f014a3796d4", - "reference": "8d4cf7561a5b17e5eb7a02b80d0b8f014a3796d4", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2016-11-24T00:46:43+00:00" - }, - { - "name": "symfony/finder", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "a69cb5d455b4885ca376dc5bb3e1155cc8c08c4b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a69cb5d455b4885ca376dc5bb3e1155cc8c08c4b", - "reference": "a69cb5d455b4885ca376dc5bb3e1155cc8c08c4b", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2016-12-13T09:39:43+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-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-11-14T01:06:16+00:00" - }, - { - "name": "symfony/process", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "02ea84847aad71be7e32056408bb19f3a616cdd3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/02ea84847aad71be7e32056408bb19f3a616cdd3", - "reference": "02ea84847aad71be7e32056408bb19f3a616cdd3", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2016-11-24T10:40:28+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "a7095af4b97a0955f85c8989106c249fa649011f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/a7095af4b97a0955f85c8989106c249fa649011f", - "reference": "a7095af4b97a0955f85c8989106c249fa649011f", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "symfony/console": "~2.8|~3.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2016-12-10T10:07:06+00:00" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14T21:17:01+00:00" - }, - { - "name": "guzzle/guzzle", - "version": "v3.8.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4de0618a01b34aa1c8c33a3f13f396dcd3882eba", - "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": ">=2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" - }, - "require-dev": { - "doctrine/cache": "*", - "monolog/monolog": "1.*", - "phpunit/phpunit": "3.7.*", - "psr/log": "1.0.*", - "symfony/class-loader": "*", - "zendframework/zend-cache": "<2.3", - "zendframework/zend-log": "<2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.8-dev" - } - }, - "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" - } - ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "abandoned": "guzzlehttp/guzzle", - "time": "2014-01-28T22:29:15+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "1.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2015-12-27T11:43:31+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "shasum": "" - }, - "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.2.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "shasum": "" - }, - "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "time": "2016-11-25T06:54:22+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.6.2", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1", - "sebastian/recursion-context": "^1.0|^2.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.0", - "phpunit/phpunit": "^4.8 || ^5.6.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2016-11-21T14:58:47+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2015-10-06T15:47:00+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2016-10-03T07:40:28+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4|~5" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2016-05-12T18:03:57+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2016-11-15T14:06:22+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "4.8.31", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "98b2b39a520766bec663ff5b7ff1b729db9dbfe3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/98b2b39a520766bec663ff5b7ff1b729db9dbfe3", - "reference": "98b2b39a520766bec663ff5b7ff1b729db9dbfe3", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2016-12-09T02:45:31+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2015-10-02T06:51:40+00:00" - }, - { - "name": "satooshi/php-coveralls", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/da51d304fe8622bf9a6da39a8446e7afd432115c", - "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-simplexml": "*", - "guzzle/guzzle": "^2.8|^3.0", - "php": ">=5.3.3", - "psr/log": "^1.0", - "symfony/config": "^2.1|^3.0", - "symfony/console": "^2.1|^3.0", - "symfony/stopwatch": "^2.0|^3.0", - "symfony/yaml": "^2.0|^3.0" - }, - "suggest": { - "symfony/http-kernel": "Allows Symfony integration" - }, - "bin": [ - "bin/coveralls" - ], - "type": "library", - "autoload": { - "psr-4": { - "Satooshi\\": "src/Satooshi/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" - } - ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/satooshi/php-coveralls", - "keywords": [ - "ci", - "coverage", - "github", - "test" - ], - "time": "2016-01-20T17:35:46+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f", - "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2016-11-19T09:18:40+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2015-12-08T07:14:41+00:00" - }, - { - "name": "sebastian/environment", - "version": "1.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-08-18T05:49:44+00:00" - }, - { - "name": "sebastian/exporter", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2016-06-17T09:04:28+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12T03:26:01+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11T19:50:13+00:00" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" - }, - { - "name": "symfony/config", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "b4ec9f099599cfc5b7f4d07bb2e910781a2be5e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/b4ec9f099599cfc5b7f4d07bb2e910781a2be5e4", - "reference": "b4ec9f099599cfc5b7f4d07bb2e910781a2be5e4", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/filesystem": "~2.8|~3.0" - }, - "require-dev": { - "symfony/yaml": "~3.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Config Component", - "homepage": "https://symfony.com", - "time": "2016-12-09T07:45:17+00:00" - }, - { - "name": "symfony/stopwatch", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "5b139e1c4290e6c7640ba80d9c9b5e49ef22b841" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5b139e1c4290e6c7640ba80d9c9b5e49ef22b841", - "reference": "5b139e1c4290e6c7640ba80d9c9b5e49ef22b841", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Stopwatch Component", - "homepage": "https://symfony.com", - "time": "2016-06-29T05:43:10+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2016-11-23T20:04:58+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.5.9" - }, - "platform-dev": [] -} From c98af5dc73f8f72d9fef84548e6a98449b45f65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sun, 29 Jan 2017 19:41:02 -0300 Subject: [PATCH 8/9] [Nostromo] Make sure app is a MageApplication --- src/Command/AbstractCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Command/AbstractCommand.php b/src/Command/AbstractCommand.php index 9fa2f90..ba94164 100644 --- a/src/Command/AbstractCommand.php +++ b/src/Command/AbstractCommand.php @@ -10,6 +10,7 @@ namespace Mage\Command; +use Mage\MageApplication; use Mage\Utils; use Mage\Runtime\Runtime; use Psr\Log\LogLevel; @@ -72,6 +73,9 @@ abstract class AbstractCommand extends Command */ protected function requireConfig() { - $this->getApplication()->configure(); + $app = $this->getApplication(); + if ($app instanceof MageApplication) { + $app->configure(); + } } } From 12d9352d38229c5508472d3e28c17eff72588e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sun, 29 Jan 2017 19:43:39 -0300 Subject: [PATCH 9/9] [Nostromo] Improve Tests and Coverage --- tests/MageApplicationTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/MageApplicationTest.php b/tests/MageApplicationTest.php index c3f2705..4694fe1 100644 --- a/tests/MageApplicationTest.php +++ b/tests/MageApplicationTest.php @@ -28,6 +28,8 @@ class MageApplicationTest extends TestCase { try { $application = new MageApplication(__DIR__ . '/Resources/invalid.yml'); + $application->configure(); + $this->assertTrue(false, 'Application did not throw exception.'); } catch (Exception $exception) { $this->assertTrue($exception instanceof RuntimeException); $this->assertEquals(sprintf('The file "%s" does not have a valid Magallanes configuration.', __DIR__ . '/Resources/invalid.yml'), $exception->getMessage()); @@ -38,6 +40,8 @@ class MageApplicationTest extends TestCase { try { $application = new MageApplication(__DIR__ . '/Resources/invalid-yaml.yml'); + $application->configure(); + $this->assertTrue(false, 'Application did not throw exception.'); } catch (Exception $exception) { $this->assertTrue($exception instanceof RuntimeException); $this->assertEquals(sprintf('Error parsing the file "%s".', __DIR__ . '/Resources/invalid-yaml.yml'), $exception->getMessage()); @@ -48,6 +52,8 @@ class MageApplicationTest extends TestCase { try { $application = new MageApplication(__DIR__ . '/Resources/this-does-not-exists.yml'); + $application->configure(); + $this->assertTrue(false, 'Application did not throw exception.'); } catch (Exception $exception) { $this->assertTrue($exception instanceof RuntimeException); $this->assertEquals(sprintf('The file "%s" does not exists or is not readable.', __DIR__ . '/Resources/this-does-not-exists.yml'), $exception->getMessage());