Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13532 anikendra 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
 
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
 
25
foreach ($paths as $path) {
26
	if (file_exists($path . $ds . $dispatcher)) {
27
		$found = $path;
28
		break;
29
	}
30
}
31
 
32
if (!$found) {
33
	$rootInstall = dirname(dirname(dirname(__FILE__))) . $ds . $dispatcher;
34
	$composerInstall = dirname(dirname(__FILE__)) . $ds . $dispatcher;
35
 
36
	if (file_exists($composerInstall)) {
37
		include $composerInstall;
38
	} elseif (file_exists($rootInstall)) {
39
		include $rootInstall;
40
	} else {
41
		trigger_error('Could not locate CakePHP core files.', E_USER_ERROR);
42
	}
43
} else {
44
	include $found . $ds . $dispatcher;
45
}
46
 
47
unset($paths, $path, $found, $dispatcher, $root, $ds);
48
 
49
return ShellDispatcher::run($argv);