From f54584c126eed73086cc34550c5ea60747d8802b Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Tue, 22 Oct 2013 18:53:26 +0200 Subject: [PATCH] Don't disconnect a DB_Error, instead log for better understanding. --- classes/Memcached_DataObject.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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]); -- 2.39.5