yiic.php 834 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Yii command line script file.
  4. *
  5. * This script is meant to be run on command line to execute
  6. * one of the pre-defined console commands.
  7. *
  8. * @author Qiang Xue <qiang.xue@gmail.com>
  9. * @link http://www.yiiframework.com/
  10. * @copyright 2008-2013 Yii Software LLC
  11. * @license http://www.yiiframework.com/license/
  12. */
  13. // fix for fcgi
  14. defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
  15. defined('YII_DEBUG') or define('YII_DEBUG',true);
  16. require_once(dirname(__FILE__).'/yii.php');
  17. if(isset($config))
  18. {
  19. $app=Yii::createConsoleApplication($config);
  20. $app->commandRunner->addCommands(YII_PATH.'/cli/commands');
  21. }
  22. else
  23. $app=Yii::createConsoleApplication(array('basePath'=>dirname(__FILE__).'/cli'));
  24. $env=@getenv('YII_CONSOLE_COMMANDS');
  25. if(!empty($env))
  26. $app->commandRunner->addCommands($env);
  27. $app->run();