-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
executable file
·86 lines (45 loc) · 1.4 KB
/
index.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
<?php
/**
* Created by PhpStorm.
* User: Jimersy Lee
* Date: 2017/5/27
* Time: 14:24
*/
use Andromeda\App;
use Andromeda\Di\FactoryDefault\FactoryDefault;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Run;
include "./vendor/autoload.php";
$whoops = new Run();
$whoops->pushHandler(new PrettyPageHandler());
$whoops->register();
//分隔符 window与linux不同
define("DS", DIRECTORY_SEPARATOR);
define('ROOT', __DIR__ . DS);
//echo BASE_PATH;
define('APP_PATH', ROOT . 'App' . DS);//定义app目录
//echo APP_PATH;
// 环境常量
define('IS_CLI', PHP_SAPI == 'cli' ? true : false);
include ROOT . "/Andromeda/DiInterface.php";
include ROOT . "/Andromeda/Di.php";
include ROOT . "/Andromeda/Di/FactoryDefault.php";
include ROOT . "/Andromeda/Di/InjectionAwareInterface.php";
include ROOT . "/Andromeda/Di/Injectable.php";
include ROOT . "/Andromeda/App.php";
include ROOT . "/Andromeda/Andromeda.php";
include ROOT . "/Andromeda/Request.php";
include ROOT . "/Andromeda/Exception.php";
//容器
$di = new FactoryDefault();
require_once "Andromeda/Andromeda.php";
include ROOT . "/Andromeda/Mvc/Controller.php";
//载入路由配置 handle routes
include APP_PATH . "Config/router.php";
//载入服务配置 read service
include APP_PATH . "Config/service.php";
//载入自动加载配置
include APP_PATH . "Config/loader.php";
//应用(组件)
$app = new App($di);
Andromeda::run($di);