Pārlūkot izejas kodu

Merge remote branch 'stloyd/patch-2'

* stloyd/patch-2:
  Throw an exception when APC is not loaded but cache is enabled in app config
Fabien Potencier 14 gadi atpakaļ
vecāks
revīzija
fe4515bde3

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

@@ -10,6 +10,10 @@ class ApcCache implements CacheInterface
 
     public function __construct($prefix)
     {
+        if (!extension_loaded('apc')) {
+            throw new \RuntimeException('First you need to enable APC extension in your php.ini. In meanwhile you can just remove "cache" option from application configuration.');
+        }
+
         $this->prefix = $prefix;
     }
 
@@ -27,4 +31,4 @@ class ApcCache implements CacheInterface
     {
         apc_store($this->prefix.$metadata->getClassName(), $metadata);
     }
-}
+}