瀏覽代碼

Fix for bug when using APC in version 3.1.4

Joseph Bielawski 14 年之前
父節點
當前提交
23b34749f9
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/Symfony/Component/Validator/Mapping/Cache/ApcCache.php

+ 8 - 0
src/Symfony/Component/Validator/Mapping/Cache/ApcCache.php

@@ -15,6 +15,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);
     }