-
Notifications
You must be signed in to change notification settings - Fork 280
/
Copy pathindex.php
40 lines (37 loc) · 1.39 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
<?php
/**
* Hornet-framework bootstrap file
*/
ini_set('session.auto_start', 'Off');
require_once '../app/globals.php';
// require_once '../../../hornet-framework/src/framework/bootstrap.php';
// 初始化开发框架基本设置
$hornetConfig = new \stdClass();
$hornetConfig->currentApp = APP_NAME;
$hornetConfig->appPath = APP_PATH;
$hornetConfig->storagePath = STORAGE_PATH;
$hornetConfig->appStatus = APP_STATUS;
$hornetConfig->enableTrace = ENABLE_TRACE;
$hornetConfig->enableXhprof = ENABLE_XHPROF;
$hornetConfig->xhprofRate = XHPROF_RATE;
$hornetConfig->xhprofRoot = PRE_APP_PATH . 'lib/xhprof/';
$hornetConfig->enableWriteReqLog = WRITE_REQUEST_LOG;
$hornetConfig->enableSecurityMap = SECURITY_MAP_ENABLE;
$hornetConfig->enableReflectMethod = ENABLE_REFLECT_METHOD;
$hornetConfig->enableFilterSqlInject = false;
$hornetConfig->enableXssFilter = false;
$hornetConfig->exceptionPage = VIEW_PATH . 'exception.php';
$hornetConfig->apiProtocolClass = 'OpenApi';
$hornetConfig->ajaxProtocolClass = 'ajax';
$hornetConfig->ctrlMethodPrefix = 'page';
$hornetConfig->customRewriteClass = "main\\app\\classes\\RewriteUrl";
$hornetConfig->customRewriteFunction = "orgRoute";
$tplEngine = 'twig';
if (defined('TPL_ENGINE')) {
$tplEngine = TPL_ENGINE;
}
$hornetConfig->tplEngine = $tplEngine;
// 实例化开发框架对象
$framework = new framework\HornetEngine($hornetConfig);
// 执行路由分发
$framework->route();