php include all_project cfg php define TPL_PATH SYS_ROOT _tpl define C

 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
<?php
include 'all_project.cfg.php';
define('TPL_PATH',SYS_ROOT.'_tpl/');
define('CFG_PATH',SITE_PATH.'_cfg/');
require_once(KERNEL_PATH.'services/project.class.php');
$Application->load(array('db','data','trace'),'class');
$Application->load(array('loader'),'mod');
$Application->load(array('user','messenger','func','news'),'lib');
$Application->load(array('msg'),'cfg');
$db->connect();
$db->post('SET NAMES `utf8`');
$GLOBALS['user'] = $user = new User();
define('LOGIN_PATH', HTTP_ROOT.'login.php');
// ( )
if (!$user->isLogined() && FILE_NAME != basename(LOGIN_PATH, '.php')){
$Application->jump(LOGIN_PATH);
}
// ( )
elseif ($user->isLogined() && FILE_NAME == basename(LOGIN_PATH, '.php')){
$Application->jump(HTTP_ROOT);
}
?>