-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbee
More file actions
executable file
·70 lines (55 loc) · 1.73 KB
/
bee
File metadata and controls
executable file
·70 lines (55 loc) · 1.73 KB
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
#!/usr/bin/env php
<?php
/*
|--------------------------------------------------------------------------
| 环境常量定义(框架)
|--------------------------------------------------------------------------
*/
// 应用名称
define('APP_NAME', 'BEE');
// 系统根路径
define('ROOT_PATH', __DIR__);
// 运行时目录
define('RUNTIME_PATH', ROOT_PATH . '/runtime');
// 配置目录
define('CONFIG_PATH', ROOT_PATH . '/config');
/*
|--------------------------------------------------------------------------
| 运行环境设置
|--------------------------------------------------------------------------
*/
// 开启错误显示
ini_set('display_errors',false);
// 开启错误报告
ini_set('error_reporting', E_ALL);
// 取消脚本最大执行时间
ini_set('max_execution_time', 0);
// 设置境时区
ini_set('date.timezone', 'PRC');
/*
|--------------------------------------------------------------------------
| 加载composer
|--------------------------------------------------------------------------
*/
$autoloadFile = ROOT_PATH . '/vendor/autoload.php';
if (!is_file($autoloadFile)) {
fwrite(STDERR, 'Composer加载文件未找到,请更新相关依赖。');
exit(0);
}
require $autoloadFile;
/*
|--------------------------------------------------------------------------
| 引导相关服务启动
|--------------------------------------------------------------------------
*/
try {
// 创建容器
$di = new \Bee\Di\Container();
// 加载框架自定义组件
// 框架服务及配置文件注入全局容器
require(CONFIG_PATH . '/di.php');
// 应用启动
(new \Bee\Cli\Console($di->getShared('config.console')))->launch($_SERVER['argv']);
} catch (\Throwable $e) {
print_r($e);
}