正在显示
2 个修改的文件
包含
24 行增加
和
24 行删除
@@ -45,7 +45,7 @@ class Db { | @@ -45,7 +45,7 @@ class Db { | ||
45 | public function __construct() | 45 | public function __construct() |
46 | { | 46 | { |
47 | 47 | ||
48 | - $this->connect(); | 48 | +// $this->connect(); |
49 | 49 | ||
50 | } | 50 | } |
51 | 51 | ||
@@ -97,11 +97,11 @@ class Db { | @@ -97,11 +97,11 @@ class Db { | ||
97 | static::$instance = new Db(); | 97 | static::$instance = new Db(); |
98 | } | 98 | } |
99 | 99 | ||
100 | - if(!static::$instance->ping()){ | ||
101 | - static::$instance->close(); | ||
102 | - | ||
103 | - static::$instance = new Db(); | ||
104 | - } | 100 | +// if(!static::$instance->ping()){ |
101 | +// static::$instance->close(); | ||
102 | +// | ||
103 | +// static::$instance = new Db(); | ||
104 | +// } | ||
105 | 105 | ||
106 | return static::$instance; | 106 | return static::$instance; |
107 | } | 107 | } |
@@ -413,24 +413,24 @@ trait DbQuery { | @@ -413,24 +413,24 @@ trait DbQuery { | ||
413 | } | 413 | } |
414 | 414 | ||
415 | 415 | ||
416 | - /** | ||
417 | - * 验证是否正常连接 | ||
418 | - * @return bool | ||
419 | - * @author:dc | ||
420 | - * @time 2024/4/10 10:09 | ||
421 | - */ | ||
422 | - public function ping(){ | ||
423 | - try { | ||
424 | - $query = $this->getClient()->query("select 200;"); | ||
425 | - if($query->fetchColumn() == 200){ | ||
426 | - return true; | ||
427 | - } | ||
428 | - }catch (\Throwable $e){ | ||
429 | - return false; | ||
430 | - } | ||
431 | - | ||
432 | - return false; | ||
433 | - } | 416 | +// /** |
417 | +// * 验证是否正常连接 | ||
418 | +// * @return bool | ||
419 | +// * @author:dc | ||
420 | +// * @time 2024/4/10 10:09 | ||
421 | +// */ | ||
422 | +// public function ping(){ | ||
423 | +// try { | ||
424 | +// $query = $this->getClient()->query("select 200;"); | ||
425 | +// if($query->fetchColumn() == 200){ | ||
426 | +// return true; | ||
427 | +// } | ||
428 | +// }catch (\Throwable $e){ | ||
429 | +// return false; | ||
430 | +// } | ||
431 | +// | ||
432 | +// return false; | ||
433 | +// } | ||
434 | 434 | ||
435 | 435 | ||
436 | } | 436 | } |
-
请 注册 或 登录 后发表评论