]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Don't disconnect a DB_Error, instead log for better understanding.
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 22 Oct 2013 16:53:26 +0000 (18:53 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 22 Oct 2013 16:56:56 +0000 (18:56 +0200)
classes/Memcached_DataObject.php

index 99056541c5328f126b2546280ad1a3311e3b6cbc..0084c42ad6cde1bfc07f9ee433b9d8bee5333808 100644 (file)
@@ -758,7 +758,9 @@ class Memcached_DataObject extends Safe_DataObject
         // we'll need some fancier logic here.
         if (!$exists && !empty($_DB_DATAOBJECT['CONNECTIONS']) && php_sapi_name() == 'cli') {
             foreach ($_DB_DATAOBJECT['CONNECTIONS'] as $index => $conn) {
-                if (!empty($conn)) {
+                if ($_PEAR->isError($conn)) {
+                    common_log(LOG_WARNING, __METHOD__ . " cannot disconnect failed DB connection: '".$conn->getMessage()."'.");
+                } elseif (!empty($conn)) {
                     $conn->disconnect();
                 }
                 unset($_DB_DATAOBJECT['CONNECTIONS'][$index]);