added exceptions when APC is not enabled

This commit is contained in:
Fabien Potencier 2011-05-14 17:43:25 +02:00
parent fe4515bde3
commit 4ef13b6d5c
2 changed files with 5 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;