cake.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/php -q
  2. <?php
  3. /**
  4. * PHP 5
  5. *
  6. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  7. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  8. *
  9. * Licensed under The MIT License
  10. * For full copyright and license information, please see the LICENSE.txt
  11. * Redistributions of files must retain the above copyright notice.
  12. *
  13. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  14. * @link http://cakephp.org CakePHP(tm) Project
  15. * @since CakePHP(tm) v 1.2.0.5012
  16. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  17. */
  18. $cakeRoot = dirname(dirname(dirname(__DIR__)));
  19. $app = 'App';
  20. $appIndex = array_search('-app', $argv);
  21. if ($appIndex !== false) {
  22. $app = $argv[$appIndex + 1];
  23. }
  24. // Path to default App skeleton.
  25. $path = $cakeRoot . '/../../' . $app . '/Config/bootstrap.php';
  26. if (!file_exists($path)) {
  27. fwrite(STDERR, "Unable to load CakePHP libraries. If you are not using the default App directory, you will need to use the -app flag.\n");
  28. exit(10);
  29. }
  30. require $path;
  31. unset($cakeRoot, $path, $app, $appIndex);
  32. exit(Cake\Console\ShellDispatcher::run($argv));