浏览代码

Merge remote branch 'stloyd/patch-3'

* stloyd/patch-3:
  Fix for bug when using APC in version 3.1.4
Fabien Potencier 14 年之前
父节点
当前提交
1394183a68
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      src/Symfony/Component/Validator/Mapping/Cache/ApcCache.php

+ 9 - 1
src/Symfony/Component/Validator/Mapping/Cache/ApcCache.php

@@ -19,6 +19,14 @@ class ApcCache implements CacheInterface
 
     public function has($class)
     {
+        if (!function_exists('apc_exists')) {
+            $exists = false;
+
+            apc_fetch($this->prefix.$class, $exists);
+
+            return $exists;
+        }
+
         return apc_exists($this->prefix.$class);
     }
 
@@ -31,4 +39,4 @@ class ApcCache implements CacheInterface
     {
         apc_store($this->prefix.$metadata->getClassName(), $metadata);
     }
-}
+}