Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Commit

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

Closes #463
  • Loading branch information
froschdesign committed Nov 27, 2014
1 parent 1ef20a2 commit cc389ea
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 cc389ea

Please sign in to comment.