From 4835d3d6027525476fab0e4145214a99f32f9a74 Mon Sep 17 00:00:00 2001 From: Marc Bennewitz Date: Mon, 22 Dec 2014 09:06:32 +0100 Subject: [PATCH] Cache: fixed CAS-Feature broken for APC adapter since 2.3.0 --- src/Storage/Adapter/Apc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Storage/Adapter/Apc.php b/src/Storage/Adapter/Apc.php index c2336e9..6d69174 100644 --- a/src/Storage/Adapter/Apc.php +++ b/src/Storage/Adapter/Apc.php @@ -746,6 +746,10 @@ protected function normalizeMetadata(array & $metadata) */ protected function internalCheckAndSetItem(& $token, & $normalizedKey, & $value) { - return apc_cas($normalizedKey, $token, $value); + if (is_int($token) && is_int($value)) { + return apc_cas($normalizedKey, $token, $value); + } + + return parent::internalCheckAndSetItem($token, $normalizedKey, $value); } }