Skip to content

Commit

Permalink
Fixes zendframework#453: Zend_Cache_Backend_Memcached looks at "bytes…
Browse files Browse the repository at this point in the history
…", but Couchbase 1.x returns "mem_used"

Closes zendframework#463
  • Loading branch information
froschdesign authored and Dimitris Giotas committed Jun 17, 2016
1 parent 4b6db4f commit 0325fa9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/Zend/Cache/Backend/Memcached.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,12 @@ public function getFillingPercentage()
}

$eachSize = $mem['limit_maxbytes'];
$eachUsed = $mem['bytes'];

/**
* Couchbase 1.x uses 'mem_used' instead of 'bytes'
* @see https://www.couchbase.com/issues/browse/MB-3466
*/
$eachUsed = isset($mem['bytes']) ? $mem['bytes'] : $mem['mem_used'];
if ($eachUsed > $eachSize) {
$eachUsed = $eachSize;
}
Expand Down

0 comments on commit 0325fa9

Please sign in to comment.