Skip to content
Permalink
Browse files

Fix cake console so it works from vendor/bin

  • Loading branch information...
markstory committed Nov 16, 2012
1 parent cecf4cf commit 05c65a1b1b6f391fcb09880db41aeef01a2c666e
Showing with 19 additions and 4 deletions.
  1. +19 −4 lib/Cake/Console/cake.php
@@ -26,9 +26,24 @@
$dir = $argv[$appIndex + 1];
require $dir . '/Config/bootstrap.php';
}
// Default app directory layout
if (!$loaded && file_exists($root . '/App/Config/bootstrap.php')) {
require $root . '/App/Config/bootstrap.php';
$locations = [
// Default repository layout.
$root . '/App/Config/bootstrap.php',
// Composer vendor directory
$root . '/../../Config/bootstrap.php',
];
foreach ($locations as $path) {
if (file_exists($path)) {
$loaded = true;
require $path;
break;
}
}
if (!$loaded) {
fwrite(STDERR, "Unable to load CakePHP libraries, check your configuration/installation.\n");
exit(10);
}
unset($root, $loaded, $appIndex, $dir);
unset($root, $loaded, $appIndex, $dir, $path, $locations);
exit(Cake\Console\ShellDispatcher::run($argv));

0 comments on commit 05c65a1

Please sign in to comment.
You can’t perform that action at this time.