forked from suxiaogang/MeMe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
62 lines (58 loc) · 1.86 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
<?php
define("APP_PATH",dirname(__FILE__));
define("SP_PATH",dirname(__FILE__).'/SpeedPHP');
$spConfig = array(
"db" => array( // 数据库设置
'host' => 'SAE_MYSQL_HOST_M', // 数据库地址,一般都可以是localhost
'login' => 'SAE_MYSQL_USER', // 数据库用户名
'password' => 'SAE_MYSQL_PASS', // 数据库密码
'database' => 'SAE_MYSQL_DB', // 数据库的库名称
),
'view' => array(
'enabled' => TRUE, // 开启Smarty
'config' =>array(
'template_dir' => APP_PATH.'/tpl', // 模板目录
'compile_dir' => 'saemc://templates_c', // 编译目录
'cache_dir' => 'saemc://cached', // 缓存目录
'left_delimiter' => '[{', // smarty左限定符
'right_delimiter' => '}]', // smarty右限定符
'auto_literal' => TRUE, // Smarty3新特性
),
),
'launch' => array( // 加入挂靠点,以便开始使用Url_ReWrite的功能
'router_prefilter' => array(
array('spUrlRewrite', 'setReWrite'), // 对路由进行挂靠,处理转向地址
),
'function_url' => array(
array("spUrlRewrite", "getReWrite"), // 对spUrl进行挂靠,让spUrl可以进行Url_ReWrite地址的生成
),
),
'ext' => array(
'spUrlRewrite' => array(
'suffix' => '',
'sep' => '/',
'map' => array(
/*main*/
'about' => 'main@about',
'feedback' => 'main@feedback',
'index' => 'main@index',
'addnew' => 'main@addnew',
/*account*/
'login' => 'account@login',
'register' => 'account@register',
'resetpassword' => 'account@resetpassword',
/*user*/
'home' => 'user@home',
/*other*/
'@' => 'main@no'
),
'args' => array(
'search' => array('q','page'),
),
),
),
'dispatcher_error' => "import(APP_PATH.'/404.html');exit();",
);
require(SP_PATH."/SpeedPHP.php");
import(APP_PATH."/include/functions.php");
spRun();