-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyii
executable file
·43 lines (33 loc) · 1.28 KB
/
yii
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
38
39
40
41
42
43
#!/usr/bin/env php
<?php
/**
* Yii console bootstrap file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));
require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/config/env.php');
defined('YII_DEBUG') or define('YII_DEBUG', (boolean)getenv('YII_DEBUG'));
defined('YII_ENV') or define('YII_ENV', getenv('YII_ENV'));
// Define project directory
$rootPath = __DIR__;
// Include yii 1 and yii 2
require("$rootPath/vendor/slavcodev/yii2-yii-bridge/include.php");
// Include yii 1 app config
$v1AppConfig = require("$rootPath/yii1-config/console.php");
// fix for fcgi
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
// Create old console application, but NOT run it!
$yii1app=Yii::createConsoleApplication($v1AppConfig);
$yii1app->commandRunner->addCommands(YII1_PATH.'/cli/commands');
// Include yii 2 app config
require(__DIR__ . '/config/bootstrap.php');
require(__DIR__ . '/config/main.php');
$application = new yii\console\Application($config);
$exitCode = $application->run();
exit($exitCode);