From 60bac77946480c0d62fbbfb0abd26a7cd440f46d Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 17 Sep 2012 22:46:24 -0400 Subject: [PATCH] Make -app parameter work again. --- lib/Cake/Console/cake.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Console/cake.php b/lib/Cake/Console/cake.php index e4b54804a38..d710ff8ee19 100644 --- a/lib/Cake/Console/cake.php +++ b/lib/Cake/Console/cake.php @@ -18,10 +18,17 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ $root = dirname(dirname(dirname(__DIR__))); +$loaded = false; +$appIndex = array_search('-app', $argv); +if ($appIndex !== false) { + $loaded = true; + $dir = $argv[$appIndex + 1]; + require $dir . '/Config/bootstrap.php'; +} // Default app directory layout -if (file_exists($root . '/App/Config/bootstrap.php')) { +if (!$loaded && file_exists($root . '/App/Config/bootstrap.php')) { require $root . '/App/Config/bootstrap.php'; } -// TODO read ARGV for -app flag, and bootstrap that application. +unset($root, $loaded, $appIndex, $dir); return Cake\Console\ShellDispatcher::run($argv);