|
@@ -170,7 +170,7 @@ class dao {
|
|
* @return void
|
|
* @return void
|
|
*/
|
|
*/
|
|
public function __construct() {
|
|
public function __construct() {
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -989,6 +989,17 @@ class dao {
|
|
return $ret !== FALSE; # false代表表不存在
|
|
return $ret !== FALSE; # false代表表不存在
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function Ping() {
|
|
|
|
+ try {
|
|
|
|
+ $this->dbh->getAttribute(PDO::ATTR_SERVER_INFO);
|
|
|
|
+ } catch (PDOException $e) {
|
|
|
|
+ if (strpos($e->getMessage(), 'MySQL server has gone away') !== false) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Log the error.
|
|
* Log the error.
|
|
*
|
|
*
|
|
@@ -1213,7 +1224,7 @@ class sql {
|
|
private function __construct($table = '') {
|
|
private function __construct($table = '') {
|
|
global $dbh;
|
|
global $dbh;
|
|
$this->dbh = $dbh;
|
|
$this->dbh = $dbh;
|
|
- $this->magicQuote = get_magic_quotes_gpc();
|
|
|
|
|
|
+ $this->magicQuote = false; // get_magic_quotes_gpc();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|