33 lines
1.0KB

  1. #!/usr/bin/env php
  2. <?php
  3. /**
  4. * Yii console bootstrap file.
  5. *
  6. * @link http://www.yiiframework.com/
  7. * @copyright Copyright (c) 2008 Yii Software LLC
  8. * @license http://www.yiiframework.com/license/
  9. */
  10. defined('YII_DEBUG') or define('YII_DEBUG', false);
  11. defined('YII_ENV') or define('YII_ENV', 'prod');
  12. // fcgi doesn't have STDIN and STDOUT defined by default
  13. defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
  14. defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));
  15. require(__DIR__ . '/vendor/autoload.php');
  16. require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
  17. require(__DIR__ . '/common/config/bootstrap.php');
  18. require(__DIR__ . '/console/config/bootstrap.php');
  19. $config = yii\helpers\ArrayHelper::merge(
  20. require(__DIR__ . '/common/config/main.php'),
  21. require(__DIR__ . '/common/config/main-local.php'),
  22. require(__DIR__ . '/console/config/main.php'),
  23. require(__DIR__ . '/console/config/main-local.php')
  24. );
  25. $application = new yii\console\Application($config);
  26. $exitCode = $application->run();
  27. exit($exitCode);