|
|
@@ -17,21 +17,24 @@
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
|
|
*/
|
|
|
|
|
|
-$ds = DIRECTORY_SEPARATOR;
|
|
|
-$dispatcher = 'Cake' . $ds . 'Console' . $ds . 'ShellDispatcher.php';
|
|
|
+if (!defined('DS')) {
|
|
|
+ define('DS', DIRECTORY_SEPARATOR);
|
|
|
+}
|
|
|
+
|
|
|
+$dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php';
|
|
|
$found = false;
|
|
|
$paths = explode(PATH_SEPARATOR, ini_get('include_path'));
|
|
|
|
|
|
foreach ($paths as $path) {
|
|
|
- if (file_exists($path . $ds . $dispatcher)) {
|
|
|
+ if (file_exists($path . DS . $dispatcher)) {
|
|
|
$found = $path;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (!$found) {
|
|
|
- $rootInstall = dirname(dirname(dirname(__FILE__))) . $ds . $dispatcher;
|
|
|
- $composerInstall = dirname(dirname(__FILE__)) . $ds . $dispatcher;
|
|
|
+ $rootInstall = dirname(dirname(dirname(__FILE__))) . DS . $dispatcher;
|
|
|
+ $composerInstall = dirname(dirname(__FILE__)) . DS . $dispatcher;
|
|
|
|
|
|
if (file_exists($composerInstall)) {
|
|
|
include $composerInstall;
|
|
|
@@ -40,10 +43,12 @@ if (!$found) {
|
|
|
} else {
|
|
|
trigger_error('Could not locate CakePHP core files.', E_USER_ERROR);
|
|
|
}
|
|
|
+ unset($rootInstall, $composerInstall);
|
|
|
+
|
|
|
} else {
|
|
|
- include $found . $ds . $dispatcher;
|
|
|
+ include $found . DS . $dispatcher;
|
|
|
}
|
|
|
|
|
|
-unset($paths, $path, $found, $dispatcher, $root, $ds);
|
|
|
+unset($paths, $path, $found, $dispatcher);
|
|
|
|
|
|
return ShellDispatcher::run($argv);
|