cake.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/php -q
  2. <?php
  3. /**
  4. * Command-line code generation utility to automate programmer chores.
  5. *
  6. * PHP 5
  7. *
  8. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  9. * Copyright 2005-2012, Cake Software Foundation, Inc.
  10. *
  11. * Licensed under The MIT License
  12. * Redistributions of files must retain the above copyright notice.
  13. *
  14. * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  15. * @link http://cakephp.org CakePHP(tm) Project
  16. * @package Cake.Console
  17. * @since CakePHP(tm) v 1.2.0.5012
  18. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  19. */
  20. $ds = DIRECTORY_SEPARATOR;
  21. $dispatcher = 'Cake' . $ds . 'Console' . $ds . 'ShellDispatcher.php';
  22. $found = false;
  23. $paths = explode(PATH_SEPARATOR, ini_get('include_path'));
  24. foreach ($paths as $path) {
  25. if (file_exists($path . $ds . $dispatcher)) {
  26. $found = $path;
  27. break;
  28. }
  29. }
  30. if (!$found) {
  31. $root = dirname(dirname(dirname(__FILE__)));
  32. if (!include $root . $ds . $dispatcher) {
  33. trigger_error('Could not locate CakePHP core files.', E_USER_ERROR);
  34. }
  35. } else {
  36. include $found . $ds . $dispatcher;
  37. }
  38. unset($paths, $path, $found, $dispatcher, $root, $ds);
  39. return ShellDispatcher::run($argv);