[Nostromo] Update MageApplication and Composer

This commit is contained in:
Andrés Montañez 2016-12-31 14:30:26 -03:00
parent d1cf5583a0
commit 5e2cb0f9a7
2 changed files with 5 additions and 4 deletions

View file

@ -28,8 +28,5 @@
"**/Tests/" "**/Tests/"
] ]
}, },
"config": {
"bin-dir": "bin"
},
"bin": ["bin/mage"] "bin": ["bin/mage"]
} }

View file

@ -40,6 +40,10 @@ class MageApplication extends Application
*/ */
public function configure($file) 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)); $config = Yaml::parse(file_get_contents($file));
if (array_key_exists('magephp', $config)) { if (array_key_exists('magephp', $config)) {
$this->configuration = $config['magephp']; $this->configuration = $config['magephp'];
@ -61,7 +65,7 @@ class MageApplication extends Application
* *
* @param InputInterface $input * @param InputInterface $input
* @param OutputInterface $output * @param OutputInterface $output
* @throws Exception * @throws RuntimeException
*/ */
public function run(InputInterface $input = null, OutputInterface $output = null) public function run(InputInterface $input = null, OutputInterface $output = null)
{ {