Просмотр исходного кода

fixed: 注释掉get_magic_quotes_gpc

王刚 3 лет назад
Родитель
Сommit
f2c115e32e
1 измененных файлов с 13 добавлено и 2 удалено
  1. 13 2
      Gameserver/Amfphp/util/dao.php

+ 13 - 2
Gameserver/Amfphp/util/dao.php

@@ -170,7 +170,7 @@ class dao {
      * @return void
      */
     public function __construct() {
-        
+
     }
 
     /**
@@ -989,6 +989,17 @@ class dao {
         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.
      *
@@ -1213,7 +1224,7 @@ class sql {
     private function __construct($table = '') {
         global $dbh;
         $this->dbh = $dbh;
-        $this->magicQuote = get_magic_quotes_gpc();
+        $this->magicQuote = false; // get_magic_quotes_gpc();
     }
 
     /**