pictcode / lib / Cake / Console / cake.php @ 0b1b8047
履歴 | 表示 | アノテート | ダウンロード (1.547 KB)
| 1 | 635eef61 | spyder1211 | #!/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 | |||
| 20 | if (!defined('DS')) { |
||
| 21 | define('DS', DIRECTORY_SEPARATOR); |
||
| 22 | } |
||
| 23 | |||
| 24 | $dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php'; |
||
| 25 | $found = false; |
||
| 26 | $paths = explode(PATH_SEPARATOR, ini_get('include_path')); |
||
| 27 | |||
| 28 | foreach ($paths as $path) { |
||
| 29 | if (file_exists($path . DS . $dispatcher)) { |
||
| 30 | $found = $path; |
||
| 31 | break;
|
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | if (!$found) { |
||
| 36 | $rootInstall = dirname(dirname(dirname(__FILE__))) . DS . $dispatcher; |
||
| 37 | $composerInstall = dirname(dirname(__FILE__)) . DS . $dispatcher; |
||
| 38 | |||
| 39 | if (file_exists($composerInstall)) { |
||
| 40 | include $composerInstall; |
||
| 41 | } elseif (file_exists($rootInstall)) { |
||
| 42 | include $rootInstall; |
||
| 43 | } else {
|
||
| 44 | trigger_error('Could not locate CakePHP core files.', E_USER_ERROR); |
||
| 45 | } |
||
| 46 | unset($rootInstall, $composerInstall); |
||
| 47 | |||
| 48 | } else {
|
||
| 49 | include $found . DS . $dispatcher; |
||
| 50 | } |
||
| 51 | |||
| 52 | unset($paths, $path, $found, $dispatcher); |
||
| 53 | |||
| 54 | return ShellDispatcher::run($argv); |