-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.php
More file actions
52 lines (52 loc) · 2.2 KB
/
init.php
File metadata and controls
52 lines (52 loc) · 2.2 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
<?php
/**
* Infinity Studio Offcial Website.
* Copyright (C) 2016 Infinity Studio.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author LasmGratel <lasm_gratel@hotmail.com>
* @author Cannon_fotter <gfyguofanyi@gmail.com>
*/
//Charset:UTF-8
header('Content-Type:text/html;charset=utf-8');
//ROOT
define('ROOT', dirname(__FILE__));
//Timezone
date_default_timezone_set('Asia/Shanghai');
//Auto loader 妈妈再也不用担心我的学习
require ROOT . '/command/lib/LoadClass.php';
//TODO 干掉Smarty自带的Autoloader
require ROOT . '/command/lib/smarty/libs/Smarty.class.php';
$loader = new Command\Lib\LoadClass();
$loader->register();
$loader->addNamespace('Command\Controller', ROOT . '/command/controller');
$loader->addNamespace('Command\Model', ROOT . '/command/model');
$loader->addNamespace('Command\Tools', ROOT . '/command/lib');
$loader->addNamespace('Command\Interfaces', ROOT . '/command/interfaces');
$loader->addNamespace('Command\Classes', ROOT . '/command/classes');
$loader->addNamespace('Command\Classes\htmltag', ROOT . '/command/classes/htmltag');
$loader->addNamespace('Command\Classes\project', ROOT . '/command/classes/project');
//Config
require ROOT . '/command/lib/config.inc.php';
$smarty = new Smarty();
//Smarty Dir Config
$smarty->setTemplateDir(ROOT . '/command/templates/');
$smarty->setCompileDir(ROOT . '/command/templates_c/');
$smarty->setConfigDir(ROOT . '/command/configs/');
$smarty->setCacheDir(ROOT . '/command/cache/');
$smarty->caching = true; //开启缓存
$smarty->cache_lifetime = 3600; //缓存存活时间(秒)
//init
require ROOT . '/command/lib/common.php';