From 5e2cb0f9a72afd043f2ff4fe6b341e8a9efa1533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sat, 31 Dec 2016 14:30:26 -0300 Subject: [PATCH] [Nostromo] Update MageApplication and Composer --- composer.json | 3 --- src/Mage/MageApplication.php | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 68c8ed6..b3a6b6a 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,5 @@ "**/Tests/" ] }, - "config": { - "bin-dir": "bin" - }, "bin": ["bin/mage"] } diff --git a/src/Mage/MageApplication.php b/src/Mage/MageApplication.php index b0ec8ee..fb6ae7a 100644 --- a/src/Mage/MageApplication.php +++ b/src/Mage/MageApplication.php @@ -40,6 +40,10 @@ class MageApplication extends Application */ public function configure($file) { + if (!file_exists($file) || !is_readable($file)) { + throw new RuntimeException(sprintf('The file "%s" does not exists or is not readable.', $file)); + } + $config = Yaml::parse(file_get_contents($file)); if (array_key_exists('magephp', $config)) { $this->configuration = $config['magephp']; @@ -61,7 +65,7 @@ class MageApplication extends Application * * @param InputInterface $input * @param OutputInterface $output - * @throws Exception + * @throws RuntimeException */ public function run(InputInterface $input = null, OutputInterface $output = null) {