forked from yidashi/yii2cmf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Yii.php
executable file
·70 lines (58 loc) · 1.75 KB
/
Yii.php
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
if (is_file(__DIR__ . '/.env')) {
(new \Dotenv\Dotenv(__DIR__))->load();
}
defined('YII_DEBUG') or define('YII_DEBUG', env('YII_DEBUG'));
defined('YII_ENV') or define('YII_ENV', env('YII_ENV', 'prod'));
class Yii extends \yii\BaseYii
{
/**
* @var \install\Application|BaseApplication|WebApplication|ConsoleApplication the application instance
*/
public static $app;
public static function getVersion()
{
return '0.1.0';
}
public static function powered()
{
return 'Powered by ' . '<a href="http://www.51siyuan.cn/" rel="external">Yii2 CMF</a>';
}
}
spl_autoload_register(['Yii', 'autoload'], true, true);
Yii::$classMap = require(__DIR__ . '/vendor/yiisoft/yii2/classes.php');
Yii::$container = new yii\di\Container();
function checkInstalled()
{
return file_exists(Yii::getAlias('@root/web/storage/install.txt'));
}
//IDE友好
/**
* Class BaseApplication
* Used for properties that are identical for both WebApplication and ConsoleApplication
* @property \common\modules\config\components\Config $config
* @property \common\components\Storage $storage
* @property \common\components\notify\Handler $notify
*/
abstract class BaseApplication extends yii\base\Application
{
}
/**
* Class WebApplication
* Include only Web application related components here
* @property \frontend\components\Search $search
* @property \common\components\PluginManager $pluginManager
* @property \common\components\ModuleManager $moduleManager
* @property \common\components\ThemeManager $themeManager
*/
class WebApplication extends yii\web\Application
{
}
/**
* Class ConsoleApplication
* Include only Console application related components here
*
*/
class ConsoleApplication extends yii\console\Application
{
}