add fallback to disk cache
authorStricted <info@stricted.de>
Tue, 24 Dec 2013 21:13:47 +0000 (22:13 +0100)
committerStricted <info@stricted.de>
Tue, 24 Dec 2013 21:13:47 +0000 (22:13 +0100)
wcfsetup/install/files/lib/system/cache/CacheHandler.class.php

index b52a3b7ad96eb509cc01053d3aa4219f6e6ec6fc..446d0a1c9eb488840f2373c848e61f6ed87c5c29 100644 (file)
@@ -30,7 +30,12 @@ class CacheHandler extends SingletonFactory {
                // init cache source object
                try {
                        $className = 'wcf\system\cache\source\\'.ucfirst(CACHE_SOURCE_TYPE).'CacheSource';
-                       $this->cacheSource = new $className();
+                       if (class_exists($className))
+                               $this->cacheSource = new $className();
+                       else {
+                               // fallback to disk cache
+                               $this->cacheSource = new DiskCacheSource();
+                       }
                }
                catch (SystemException $e) {
                        if (CACHE_SOURCE_TYPE != 'disk') {