Base for a static organization website

cake.php 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/php -q
  2. <?php
  3. /**
  4. * Command-line code generation utility to automate programmer chores.
  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. * @package Cake.Console
  16. * @since CakePHP(tm) v 1.2.0.5012
  17. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  18. */
  19. if (!defined('DS')) {
  20. define('DS', DIRECTORY_SEPARATOR);
  21. }
  22. $dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php';
  23. $found = false;
  24. $paths = explode(PATH_SEPARATOR, ini_get('include_path'));
  25. foreach ($paths as $path) {
  26. if (file_exists($path . DS . $dispatcher)) {
  27. $found = $path;
  28. break;
  29. }
  30. }
  31. if (!$found) {
  32. $rootInstall = dirname(dirname(dirname(__FILE__))) . DS . $dispatcher;
  33. $composerInstall = dirname(dirname(__FILE__)) . DS . $dispatcher;
  34. if (file_exists($composerInstall)) {
  35. include $composerInstall;
  36. } elseif (file_exists($rootInstall)) {
  37. include $rootInstall;
  38. } else {
  39. trigger_error('Could not locate CakePHP core files.', E_USER_ERROR);
  40. }
  41. unset($rootInstall, $composerInstall);
  42. } else {
  43. include $found . DS . $dispatcher;
  44. }
  45. unset($paths, $path, $found, $dispatcher);
  46. return ShellDispatcher::run($argv);