Skip to content

Commit

Permalink
Make -app parameter work again.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 18, 2012
1 parent 5d7f6b3 commit 60bac77
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/Cake/Console/cake.php
Expand Up @@ -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);

0 comments on commit 60bac77

Please sign in to comment.