Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core/Db
diff options
context:
space:
mode:
authorvipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2009-11-11 09:39:38 +0300
committervipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2009-11-11 09:39:38 +0300
commite3317b34a10d62149b85a5b03822a6a0fd733331 (patch)
tree0a725642d2b9c2ac91460400e81dc82af6798f42 /core/Db
parent122ecee4564a296bd3605063c5fac71700ce8f5c (diff)
fix connection error detection
Diffstat (limited to 'core/Db')
-rw-r--r--core/Db/Mysqli.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/Db/Mysqli.php b/core/Db/Mysqli.php
index 6f62f9f546..814ade0c28 100644
--- a/core/Db/Mysqli.php
+++ b/core/Db/Mysqli.php
@@ -81,6 +81,11 @@ class Piwik_Db_Mysqli extends Zend_Db_Adapter_Mysqli implements Piwik_Db_iAdapte
*/
public function isErrNo($e, $errno)
{
+ if(is_null($this->_connection) && preg_match('/(?:\[|\s)([0-9]{4})(?:\]|\s)/', $e->getMessage(), $match))
+ {
+ return $match[1] == $errno;
+ }
+
return mysqli_errno($this->_connection) == $errno;
}