Database Err: SQLSTATE[HY000] [2002] Connection refused
- /www/wwwroot/sywer.ysrsar.cn/protected/lib/speed.php on line 432
427.
try {
428.
if (!class_exists("PDO") || !in_array("mysql", PDO::getAvailableDrivers(), true)) {
429.
err('Database Err: PDO or PDO_MYSQL doesn\'t exist!');
430.
}
431.
$GLOBALS['mysql_instances'][$db_config_key] = new PDO('mysql:dbname=' . $db_config['MYSQL_DB'] . ';host=' . $db_config['MYSQL_HOST'] . ';port=' . $db_config['MYSQL_PORT'], $db_config['MYSQL_USER'], $db_config['MYSQL_PASS'], array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'' . $db_config['MYSQL_CHARSET'] . '\''));
432.
433.
} catch (PDOException $e) {err('Database Err: ' . $e->getMessage());}
}
434.
return $GLOBALS['mysql_instances'][$db_config_key];
435.
}
436.
437.
private function _where($conditions) {
- /www/wwwroot/sywer.ysrsar.cn/protected/lib/speed.php on line 399
394.
395.
if ($readonly && !empty($GLOBALS['mysql']['MYSQL_SLAVE'])) {
396.
$slave_key = array_rand($GLOBALS['mysql']['MYSQL_SLAVE']);
397.
$sth = $this->dbInstance($GLOBALS['mysql']['MYSQL_SLAVE'][$slave_key], 'slave_' . $slave_key)->prepare($sql);
398.
} else {
399.
400.
$sth = $this->dbInstance($GLOBALS['mysql'], 'master')->prepare($sql);
}
401.
402.
if (is_array($params) && !empty($params)) {
403.
foreach ($params as $k => &$v) {
404.
if (is_int($v)) {
- /www/wwwroot/sywer.ysrsar.cn/protected/lib/speed.php on line 391
386.
}
387.
}
388.
return $this->page;
389.
}
390.
391.
392.
public function query($sql, $params = array()) {return $this->execute($sql, $params, true);}
public function execute($sql, $params = array(), $readonly = false) {
393.
$this->sql[] = $sql;
394.
395.
if ($readonly && !empty($GLOBALS['mysql']['MYSQL_SLAVE'])) {
396.
$slave_key = array_rand($GLOBALS['mysql']['MYSQL_SLAVE']);
- /www/wwwroot/sywer.ysrsar.cn/protected/lib/speed.php on line 304
299.
$limit = $this->pager($limit[0], $limit[1], $limit[2], $total[0]['M_COUNTER']);
300.
$limit = empty($limit) ? '' : ' LIMIT ' . $limit['offset'] . ',' . $limit['limit'];
301.
} else {
302.
$limit = !empty($limit) ? ' LIMIT ' . $limit : '';
303.
}
304.
305.
return $this->query('SELECT ' . $fields . $sql . $sort . $limit, $conditions["_bindParams"]);
}
306.
307.
public function find($conditions = array(), $sort = null, $fields = '*') {
308.
$res = $this->findAll($conditions, $sort, $fields, 1);
309.
return !empty($res) ? array_pop($res) : false;
- /www/wwwroot/sywer.ysrsar.cn/protected/controller/user/BaseController.php on line 7
2.
class BaseController extends Controller {
3.
//public $layout = "layout.html";
4.
//获取系统配置信息
5.
function Conf() {
6.
$Config = new Config();
7.
8.
$Config = $Config->findAll(); //获取系统配置
$this->conf = array();
9.
foreach ($Config as $crow) {
10.
//print_r($v);
11.
$this->conf[$crow['k']] = $crow['v'];
12.
}
- /www/wwwroot/sywer.ysrsar.cn/protected/controller/user/LoginController.php on line 209
204.
exit(json_encode($result));
205.
}
206.
207.
//本平台条款
208.
function actionTerm() {
209.
210.
$this->conf(); //引入变量 系统配置
$this->display($this->conf['Uui_Template']."/Term.html");
211.
}
212.
213.
//注册邮件发送
214.
function actionSendEmilTest() {
- /www/wwwroot/sywer.ysrsar.cn/protected/lib/speed.php on line 127
122.
if (!method_exists($controller_name, $action_name)) {
123.
_err_router("Err: Method '$action_name' of '$controller_name' is not exists!");
124.
}
125.
126.
$controller_obj = new $controller_name();
127.
128.
$controller_obj->$action_name();
129.
if ($controller_obj->_auto_display) {
130.
$auto_tpl_name = (empty($__module) ? '' : $__module . DS) . $__controller . '_' . $__action . '.html';
131.
if (file_exists(APP_DIR . DS . 'protected' . DS . 'view' . DS . $auto_tpl_name)) {
132.
$controller_obj->display($auto_tpl_name);
- /www/wwwroot/sywer.ysrsar.cn/index.php on line 45
40.
if($_GET['runcron']){
41.
//云端防止监控自动停止
42.
$ch = curl_init();curl_setopt($ch, CURLOPT_URL, ((int)$_SERVER['SERVER_PORT'] == 80 ? 'http://'.$_SERVER['HTTP_HOST'] : 'https://'.$_SERVER['HTTP_HOST']).'/Crontab/Tim/Run?r='.time());curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);curl_setopt($ch, CURLOPT_TIMEOUT, 1);curl_exec($ch);curl_close($ch);
43.
exit('站点正常哦');
44.
}
45.
require(APP_DIR.'/protected/lib/speed.php');