Removed the option to disable the entire cache
authorAlexander Ebert <ebert@woltlab.com>
Wed, 10 Sep 2014 17:53:21 +0000 (19:53 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 10 Sep 2014 17:53:21 +0000 (19:53 +0200)
Originally intended for developers, this option has caused a lot of troubles without any real use. Turning it off can cripple an entire system, e.g. the entire installation system will blow up when the cache is disabled.

In fact it has no real use, if you want to debug a cache builder, you could just add an print_r() and exit() in getData() and then clear the cache. Profit.

com.woltlab.wcf/option.xml
wcfsetup/install/files/lib/system/cache/source/NoCacheSource.class.php [deleted file]
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 8f321dd68dfd1ab00b6b05d6a7c8e594f8229bd8..41f7023858e18086c693191d87890567865b64f0 100644 (file)
@@ -815,11 +815,9 @@ debug:mail_debug_logfile_path,!mail_use_f_param,!mail_smtp_host,!mail_smtp_port,
                                <optiontype>radioButton</optiontype>
                                <defaultvalue><![CDATA[disk]]></defaultvalue>
                                <selectoptions><![CDATA[disk:wcf.acp.option.cache_source_type.disk
-memcached:wcf.acp.option.cache_source_type.memcached
-no:wcf.acp.option.cache_source_type.no]]></selectoptions>
+memcached:wcf.acp.option.cache_source_type.memcached]]></selectoptions>
                                <enableoptions><![CDATA[disk:!cache_source_memcached_host
-memcached:cache_source_memcached_host
-no:!cache_source_memcached_host]]></enableoptions>
+memcached:cache_source_memcached_host]]></enableoptions>
                        </option>
                        
                        <option name="cache_source_memcached_host">
diff --git a/wcfsetup/install/files/lib/system/cache/source/NoCacheSource.class.php b/wcfsetup/install/files/lib/system/cache/source/NoCacheSource.class.php
deleted file mode 100644 (file)
index f66ac55..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-namespace wcf\system\cache\source;
-use wcf\util\StringUtil;
-
-/**
- * NoCacheSource is an implementation of CacheSource that does not store any data.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2014 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.cache.source
- * @category   Community Framework
- */
-class NoCacheSource implements ICacheSource {
-       /**
-        * list of cached values
-        * @var array<array>
-        */
-       protected $cache = array();
-       
-       /**
-        * @see \wcf\system\cache\source\ICacheSource::flush()
-        */
-       public function flush($cacheName, $useWildcard) {
-               if (isset($this->cache[$cacheName])) {
-                       unset($this->cache[$cacheName]);
-               }
-               
-               if ($useWildcard) {
-                       $cacheName .= '-';
-                       foreach (array_keys($this->cache) as $key) {
-                               if (StringUtil::startsWith($key, $cacheName)) {
-                                       unset($this->cache[$key]);
-                               }
-                       }
-               }
-       }
-       
-       /**
-        * @see \wcf\system\cache\source\ICacheSource::flushAll()
-        */
-       public function flushAll() {
-               $this->cache = array();
-       }
-       
-       /**
-        * @see \wcf\system\cache\source\ICacheSource::get()
-        */
-       public function get($cacheName, $maxLifetime) {
-               if (isset($this->cache[$cacheName])) {
-                       return $this->cache[$cacheName];
-               }
-               
-               return null;
-       }
-       
-       /**
-        * @see \wcf\system\cache\source\ICacheSource::set()
-        */
-       public function set($cacheName, $value, $maxLifetime) {
-               $this->cache[$cacheName] = $value;
-       }
-}
index fa36f72110292fad0052ac9a6c7a316bebacd36e..761b5b4b543b4af3fb9104d29cf8e93797f86574 100644 (file)
                <item name="wcf.acp.cache.list.size"><![CDATA[Größe]]></item>
                <item name="wcf.acp.cache.source.type.DiskCacheSource"><![CDATA[Dateisystem]]></item>
                <item name="wcf.acp.cache.source.type.MemcachedCacheSource"><![CDATA[Memcached]]></item>
-               <item name="wcf.acp.cache.source.type.NoCacheSource"><![CDATA[keine (Caching deaktiviert)]]></item>
                <item name="wcf.acp.cache.type.data"><![CDATA[Daten]]></item>
                <item name="wcf.acp.cache.type.language"><![CDATA[Sprachen]]></item>
                <item name="wcf.acp.cache.type.style"><![CDATA[Stile]]></item>
                <item name="wcf.acp.option.cache_source_type.description"><![CDATA[Beachten Sie, dass einige Methoden spezielle Anforderungen an das Server-System stellen und nicht auf jedem Server zur Verfügung stehen.]]></item>
                <item name="wcf.acp.option.cache_source_type.disk"><![CDATA[Dateisystem (Standard)]]></item>
                <item name="wcf.acp.option.cache_source_type.memcached"><![CDATA[Memcached]]></item>
-               <item name="wcf.acp.option.cache_source_type.no"><![CDATA[Caching deaktivieren (Nicht empfohlen)]]></item>
                <item name="wcf.acp.option.category.general"><![CDATA[Allgemein]]></item>
                <item name="wcf.acp.option.category.general.cache"><![CDATA[Cache]]></item>
                <item name="wcf.acp.option.category.general.cache.general"><![CDATA[Allgemein]]></item>
index 756a99a15419bd2b8f4692f2db27f70104ae0bc1..3ab2f88873498b83cc73f280b01687b3b5947b46 100644 (file)
@@ -133,7 +133,6 @@ Examples for medium ID detection:
                <item name="wcf.acp.cache.list.size"><![CDATA[Size]]></item>
                <item name="wcf.acp.cache.source.type.DiskCacheSource"><![CDATA[Filesystem]]></item>
                <item name="wcf.acp.cache.source.type.MemcachedCacheSource"><![CDATA[Memcached]]></item>
-               <item name="wcf.acp.cache.source.type.NoCacheSource"><![CDATA[None (caching disabled)]]></item>
                <item name="wcf.acp.cache.type.data"><![CDATA[Data]]></item>
                <item name="wcf.acp.cache.type.language"><![CDATA[Languages]]></item>
                <item name="wcf.acp.cache.type.style"><![CDATA[Styles]]></item>
@@ -686,7 +685,6 @@ Examples for medium ID detection:
                <item name="wcf.acp.option.cache_source_type.description"><![CDATA[Caching methods different from “Filesystem” require special extensions or services running on your machine.]]></item>
                <item name="wcf.acp.option.cache_source_type.disk"><![CDATA[Filesystem (default)]]></item>
                <item name="wcf.acp.option.cache_source_type.memcached"><![CDATA[Memcached]]></item>
-               <item name="wcf.acp.option.cache_source_type.no"><![CDATA[Disable caching (not recommended)]]></item>
                <item name="wcf.acp.option.category.general"><![CDATA[General]]></item>
                <item name="wcf.acp.option.category.general.cache"><![CDATA[Cache]]></item>
                <item name="wcf.acp.option.category.general.cache.general"><![CDATA[General]]></item>