Disables the cache entirely, useful for debugging purposes.
<defaultvalue><![CDATA[disk]]></defaultvalue>
<selectoptions><![CDATA[disk:wcf.acp.option.cache_source_type.disk
memcache:wcf.acp.option.cache_source_type.memcache
-apc:wcf.acp.option.cache_source_type.apc]]></selectoptions>
+apc:wcf.acp.option.cache_source_type.apc
+no:wcf.acp.option.cache_source_type.no]]></selectoptions>
<enableoptions><![CDATA[disk:!cache_source_memcache_host,!cache_source_memcache_use_pconnect,!enable_session_data_cache
memcache:cache_source_memcache_host,cache_source_memcache_use_pconnect,enable_session_data_cache
-apc:!cache_source_memcache_host,!cache_source_memcache_use_pconnect,!enable_session_data_cache]]></enableoptions>
+apc:!cache_source_memcache_host,!cache_source_memcache_use_pconnect,!enable_session_data_cache
+no:!cache_source_memcache_host,!cache_source_memcache_use_pconnect,!enable_session_data_cache]]></enableoptions>
</option>
<option name="enable_session_data_cache">
<dd>{$cacheData.version}</dd>
</dl>
{/if}
- <dl>
+ {if $cacheData.size}<dl>
<dt>{lang}wcf.acp.cache.data.size{/lang}</dt>
<dd>{@$cacheData.size|filesize}</dd>
- </dl>
- <dl>
+ </dl>{/if}
+ {if $cacheData.files}<dl>
<dt>{lang}wcf.acp.cache.data.files{/lang}</dt>
<dd>{#$cacheData.files}</dd>
- </dl>
+ </dl>{/if}
{if $additionalFields|isset}{@$additionalFields}{/if}
</fieldset>
<div class="contentHeader">
<nav class="largeButtons">
<ul>
- <li><a onclick="return confirm('{lang}wcf.acp.cache.clear.sure{/lang}')" href="index.php?action=CacheClear{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/delete1.svg" alt="" /> <span>{lang}wcf.acp.cache.button.clear{/lang}</span></a></li>
+ {if $cacheData.files}<li><a onclick="return confirm('{lang}wcf.acp.cache.clear.sure{/lang}')" href="index.php?action=CacheClear{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/delete1.svg" alt="" /> <span>{lang}wcf.acp.cache.button.clear{/lang}</span></a></li>{/if}
{if $additionalLargeButtons|isset}{@$additionalLargeButtons}{/if}
</ul>
</nav>
<div class="contentFooter">
<nav class="largeButtons">
<ul>
- <li><a onclick="return confirm('{lang}wcf.acp.cache.clear.sure{/lang}')" href="index.php?action=CacheClear{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/delete1.svg" alt="" /> <span>{lang}wcf.acp.cache.button.clear{/lang}</span></a></li>
+ {if $cacheData.files}<li><a onclick="return confirm('{lang}wcf.acp.cache.clear.sure{/lang}')" href="index.php?action=CacheClear{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/delete1.svg" alt="" /> <span>{lang}wcf.acp.cache.button.clear{/lang}</span></a></li>{/if}
{if $additionalLargeButtons|isset}{@$additionalLargeButtons}{/if}
</ul>
</nav>
}
}
}
+ // disabled
+ else if ($this->cacheData['source'] == 'wcf\system\cache\source\NoCacheSource') {
+ $this->cacheData['version'] = WCF_VERSION;
+ $this->cacheData['files'] = $this->cacheData['size'] = 0;
+ }
}
/**
--- /dev/null
+<?php
+namespace wcf\system\cache\source;
+
+/**
+ * DevNullCacheSource is an implementation of CacheSource that stores the cache in /dev/null.
+ *
+ * @author Tim Düsterhus
+ * @copyright 2011 Tim Düsterhus
+ * @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 {
+ /**
+ * @see wcf\system\cache\source\ICacheSource::get()
+ */
+ public function get(array $cacheResource) {
+ if (!isset($this->cache[$cacheResource['cache']])) return null;
+
+ return $this->cache[$cacheResource['cache']];
+ }
+
+ /**
+ * @see wcf\system\cache\source\ICacheSource::set()
+ */
+ public function set(array $cacheResource, $value) {
+ // we have to keep it temporarily
+ $this->cache[$cacheResource['cache']] = $value;
+ $this->loaded[$cacheResource['file']] = true;
+ }
+
+ /**
+ * @see wcf\system\cache\source\ICacheSource::delete()
+ */
+ public function delete(array $cacheResource) {
+ // reset open cache
+ if (isset($this->cache[$cacheResource['cache']])) unset($this->cache[$cacheResource['cache']]);
+ if (isset($this->loaded[$cacheResource['file']])) unset($this->loaded[$cacheResource['file']]);
+
+ return;
+ }
+
+ /**
+ * @see wcf\system\cache\source\ICacheSource::clear()
+ */
+ public function clear($directory, $filepattern) {
+ return;
+ }
+
+ /**
+ * @see wcf\system\cache\source\ICacheSource::close()
+ */
+ public function close() {
+ return;
+ }
+
+ /**
+ * @see wcf\system\cache\source\ICacheSource::flush()
+ */
+ public function flush() {
+ return;
+ }
+}
<item name="wcf.acp.option.cache_source_type.description"><![CDATA[Bitte wähle die gewünschte Cache-Methode aus! Beachte, 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.memcache"><![CDATA[Memcache (Experimentell)]]></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.description"><![CDATA[]]></item>
<item name="wcf.acp.option.cache_source_type.description"><![CDATA[Bitte wählen Sie die gewünschte Cache-Methode aus! 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.memcache"><![CDATA[Memcache]]></item>
+ <item name="wcf.acp.option.cache_source_type.no"><![CDATA[Caching deaktivieren (Nicht empfohlen)]]></item>
<item name="wcf.acp.option.blacklist_hostnames"><![CDATA[Hostname ausschließen]]></item>
<item name="wcf.acp.option.blacklist_hostnames.description"><![CDATA[Geben Sie pro Zeile einen Hostname an, die Sie von der Seite ausschließen möchten.]]></item>
<item name="wcf.acp.option.blacklist_ip_addresses"><![CDATA[IP-Adresse ausschließen]]></item>
<item name="wcf.acp.option.cache_source_type.description"><![CDATA[Please select the type of cache you want to use. Some of the types have special requirements to the server system and cannot be used in your environment.]]></item>
<item name="wcf.acp.option.cache_source_type.disk"><![CDATA[File system (default)]]></item>
<item name="wcf.acp.option.cache_source_type.memcache"><![CDATA[Memcache (experimental)]]></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.description"><![CDATA[]]></item>