Browse Source

added exceptions when APC is not enabled

Fabien Potencier 14 years ago
parent
commit
4ef13b6d5c

+ 4 - 0
src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php

@@ -73,6 +73,10 @@ class ApcUniversalClassLoader extends UniversalClassLoader
      */
     public function __construct($prefix)
     {
+        if (!extension_loaded('apc')) {
+            throw new \RuntimeException('Unable to use ApcUniversalClassLoader as APC is not enabled.');
+        }
+
         $this->prefix = $prefix;
     }
 

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

@@ -11,7 +11,7 @@ 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.');
+            throw new \RuntimeException('Unable to use ApcCache to cache validator mappings as APC is not enabled.');
         }
 
         $this->prefix = $prefix;