-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathconfig.php
46 lines (39 loc) · 951 Bytes
/
config.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
<?php
/**
* @author: FeiYan.info
*/
if (!defined('IM_FEIYAN'))
{
die('Hacking Attempt');
}
#root path
define("ROOTPATH",ereg_replace("[/\\]{1,}", '/', dirname(__FILE__))."/");
#DB (sqlite,mysql)
define( 'DB_TYPE', 'sqlite' );
#mysql configuration
define( 'MYSQL_SERVER', 'localhost' );
define( 'MYSQL_DATABASE', 'dbname' );
define( 'MYSQL_USER', 'dbuser' );
define( 'MYSQL_PASS', 'dbpass' );
#sqlite configuration
define("SQLITE_DSN","sqlite:".ROOTPATH."db/words.db"); //数据库服务器路径
define("SQLITE_USERNAME",""); //数据库用户名
define("SQLITE_PASSWD",""); //数据库密码
#load functions
require_once ROOTPATH . 'functions.php';
$class = DB_TYPE;
$db = new $class();
unset($class);
/*init $db
if( defined(DB_TYPE) ) {
switch ( DB_TYPE )
{
case "sqlite": $db = new sqlite(); break;
case "mysql": $db = new mysql(); break;
default: $db = new sqlite();
}
} else {
$db = new sqlite();
}
**/
?>