From: Mikael Nordfeldth Date: Tue, 22 Oct 2013 16:53:26 +0000 (+0200) Subject: Don't disconnect a DB_Error, instead log for better understanding. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f54584c126eed73086cc34550c5ea60747d8802b;p=quix0rs-gnu-social.git Don't disconnect a DB_Error, instead log for better understanding. --- diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 99056541c5..0084c42ad6 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -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]);