Skip to content

Commit b2cd163

Browse files
committed
替换数据库操作类,修改所有代码(未全部修改完)
1 parent afbff88 commit b2cd163

17 files changed

Lines changed: 1308 additions & 803 deletions

‎ajax.php‎

Lines changed: 444 additions & 285 deletions
Large diffs are not rendered by default.

‎global.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
chdir(dirname(__FILE__));
33
//数据库操作类
4-
require('inc/db.class.php');
4+
require('inc/medoo.php');
55
//函数库
66
require('inc/functions.php');
77
//配置文件

‎inc/config.php‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
$_REQUEST = daddslashes($_REQUEST, 1, TRUE);
2424
$_COOKIE = daddslashes($_COOKIE, 1, TRUE);
2525

26-
trim(@extract($_POST));
27-
trim(@extract($_GET));
28-
trim(@extract($_REQUEST));
29-
3026
$_CONFIG = array(
3127
'authkey' => 'hoorayos', //站点加密密钥,可随意更改
3228
'COOKIE_PREFIX' => '',
@@ -72,15 +68,15 @@
7268
'noPermissions'=>'1002'
7369
);
7470

75-
//数据库连接配置信息
76-
$db_hoorayos_config = array(
77-
'dsn'=>'mysql:host=localhost;dbname=hoorayos',
78-
'name'=>'root',
79-
'password'=>''
80-
);
81-
8271
//创建数据库连接
83-
$db = new HRDB($db_hoorayos_config);
72+
$db = new medoo(array(
73+
'database_name' => 'hoorayos',
74+
'username' => 'root',
75+
'password' => '',
76+
'option' => array(
77+
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
78+
)
79+
));
8480

8581
//社区登录公用变量配置信息
8682
//新浪微博

‎inc/db.class.php‎

Lines changed: 0 additions & 272 deletions
This file was deleted.

0 commit comments

Comments
 (0)