summaryrefslogtreecommitdiff
path: root/framework/yiic.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/yiic.php')
-rw-r--r--framework/yiic.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/framework/yiic.php b/framework/yiic.php
new file mode 100644
index 0000000..b057a9c
--- /dev/null
+++ b/framework/yiic.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Yii command line script file.
+ *
+ * This script is meant to be run on command line to execute
+ * one of the pre-defined console commands.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.yiiframework.com/
+ * @copyright Copyright &copy; 2008-2011 Yii Software LLC
+ * @license http://www.yiiframework.com/license/
+ * @version $Id: yiic.php 2799 2011-01-01 19:31:13Z qiang.xue $
+ */
+
+// fix for fcgi
+defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
+
+defined('YII_DEBUG') or define('YII_DEBUG',true);
+
+require_once(dirname(__FILE__).'/yii.php');
+
+if(isset($config))
+{
+ $app=Yii::createConsoleApplication($config);
+ $app->commandRunner->addCommands(YII_PATH.'/cli/commands');
+ $env=@getenv('YII_CONSOLE_COMMANDS');
+ if(!empty($env))
+ $app->commandRunner->addCommands($env);
+}
+else
+ $app=Yii::createConsoleApplication(array('basePath'=>dirname(__FILE__).'/cli'));
+
+$app->run(); \ No newline at end of file