-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathyiic.php
More file actions
37 lines (29 loc) · 1.32 KB
/
Copy pathyiic.php
File metadata and controls
37 lines (29 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
$lcYiiDirectory = NULL;
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
defined('YII_DEBUG') or define('YII_DEBUG',true);
defined('YIIPLINTH_FRAMEWORK') or define('YIIPLINTH_FRAMEWORK', dirname(__FILE__).DIRECTORY_SEPARATOR);
// Extract the Required Folders
echo "Discovering Yii Folder: ";
$lcPath = dirname(dirname(__FILE__));
$laDirectories = scandir($lcPath);
foreach ($laDirectories as $lcDir)
{
if (is_dir($lcDir) && $lcDir !== '.' && $lcDir !=='..' && preg_match('/^yii-.+/i',$lcDir))
{
$lcYiiDirectory = file_exists($lcPath.DIRECTORY_SEPARATOR.$lcDir.DIRECTORY_SEPARATOR.'framework')? $lcPath.DIRECTORY_SEPARATOR.$lcDir.DIRECTORY_SEPARATOR : NULL;
echo $lcYiiDirectory."\n";
defined('YII_FRAMEWORK') or define('YII_FRAMEWORK', $lcYiiDirectory);
}
}
if (is_null($lcYiiDirectory))
{
throw new Exception("Yii Framework Directory not found in [$lcPath]");
}
// We know where Yii is, so time to get going.
require_once($lcYiiDirectory.'framework/yii.php');
// Include the Utilities always
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'protected'.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'Utilities.php');
$loApp=Yii::createConsoleApplication(array('basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'protected'.DIRECTORY_SEPARATOR.'cli'));
$loApp->run();
?>