Add RedisCacheSource and ACP options
authorMaximilian Mader <max@bastelstu.be>
Sun, 21 Dec 2014 00:39:42 +0000 (01:39 +0100)
committerMaximilian Mader <max@bastelstu.be>
Fri, 29 May 2015 01:49:00 +0000 (03:49 +0200)
com.woltlab.wcf/option.xml
wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php [new file with mode: 0644]
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 9de7014f4e6e7e52e5b90f38eb0c6b4cdbb444be..0fac46d00273ce603272656dd47cb2da6510a2fe 100644 (file)
@@ -89,6 +89,9 @@
                                        <category name="general.cache.memcached">
                                                <parent>general.cache</parent>
                                        </category>
+                                       <category name="general.cache.redis">
+                                               <parent>general.cache</parent>
+                                       </category>
                                <category name="general.payment">
                                        <parent>general</parent>
                                        <showorder>6</showorder>
@@ -830,15 +833,21 @@ 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]]></selectoptions>
-                               <enableoptions><![CDATA[disk:!cache_source_memcached_host
-memcached:cache_source_memcached_host]]></enableoptions>
+memcached:wcf.acp.option.cache_source_type.memcached
+redis:wcf.acp.option.cache_source_type.redis]]></selectoptions>
+                               <enableoptions><![CDATA[disk:!cache_source_memcached_host,!cache_source_redis_host
+memcached:cache_source_memcached_host,!cache_source_redis_host
+redis:cache_source_redis_host,!cache_source_memcached_host]]></enableoptions>
                        </option>
                        
                        <option name="cache_source_memcached_host">
                                <categoryname>general.cache.memcached</categoryname>
                                <optiontype>textarea</optiontype>
                        </option>
+                       <option name="cache_source_redis_host">
+                               <categoryname>general.cache.redis</categoryname>
+                               <optiontype>text</optiontype>
+                       </option>
                        <!-- /general.cache -->
                        
                        <!-- general.payment -->
diff --git a/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php b/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php
new file mode 100644 (file)
index 0000000..d606dc9
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+namespace wcf\system\cache\source;
+use wcf\system\exception\SystemException;
+use wcf\system\WCF;
+
+/**
+ * RedisCacheSource is an implementation of CacheSource that uses a Redis server to store cached variables.
+ * 
+ * @author     Maximilian Mader
+ * @copyright  2001-2015 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 RedisCacheSource implements ICacheSource {
+       /**
+        * @see \wcf\system\cache\source\ICacheSource::flush()
+        */
+       public function flush($cacheName, $useWildcard) {
+               
+       }
+       
+       /**
+        * @see \wcf\system\cache\source\ICacheSource::flushAll()
+        */
+       public function flushAll() {
+               
+       }
+       
+       /**
+        * @see \wcf\system\cache\source\ICacheSource::get()
+        */
+       public function get($cacheName, $maxLifetime) {
+               
+       }
+       
+       /**
+        * @see \wcf\system\cache\source\ICacheSource::set()
+        */
+       public function set($cacheName, $value, $maxLifetime) {
+               
+       }
+}
index 107fb5ddcb8357fdda870d7b3f89115f94791fdb..02bb8ac0d9ecab0002f8ebb332861543add438ac 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.RedisCacheSource"><![CDATA[Redis]]></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.blacklist_user_agents.description"><![CDATA[Eine Browser-Kennung (User-Agent) pro Zeile]]></item>
                <item name="wcf.acp.option.cache_source_memcached_host"><![CDATA[Memcached-Server]]></item>
                <item name="wcf.acp.option.cache_source_memcached_host.description"><![CDATA[Mehrere Server können zeilenweise angegeben und die Gewichtung als dritter Parameter angegeben werden, zum Beispiel „localhost:11211:67“ oder „10.0.13.37:31337:33“.]]></item>
+               <item name="wcf.acp.option.cache_source_redis_host"><![CDATA[Redis-Server]]></item>
+               <item name="wcf.acp.option.cache_source_redis_host.description"><![CDATA[Die Adresse des Servers, zum Beispiel „localhost“ oder „10.0.13.37:1337“.]]></item>
                <item name="wcf.acp.option.cache_source_type"><![CDATA[Cache-Methode]]></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.redis"><![CDATA[Redis]]></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>
                <item name="wcf.acp.option.category.general.cache.memcached"><![CDATA[Memcached]]></item>
                <item name="wcf.acp.option.category.general.cache.memcached.description"><![CDATA[Memcached speichert häufig benötigte Daten im Arbeitsspeicher zwischen. Dies kann die Last auf die Datenbank und das Dateisystem drastisch reduzieren. Lesen Sie mehr über dieses Thema auf der folgenden Seite: <a href="http://memcached.org/" class="externalURL">memcached.org</a>.]]></item>
+               <item name="wcf.acp.option.category.general.cache.redis"><![CDATA[Redis]]></item>
+               <item name="wcf.acp.option.category.general.cache.redis.description"><![CDATA[Redis speichert häufig benötigte Daten im Arbeitsspeicher zwischen. Dies kann die Last auf die Datenbank und das Dateisystem drastisch reduzieren. Lesen Sie mehr über dieses Thema auf der folgenden Seite: <a href="http://redis.io/" class="externalURL">redis.io</a>.]]></item>
                <item name="wcf.acp.option.category.general.system.date"><![CDATA[Datum &amp; Zeit]]></item>
                <item name="wcf.acp.option.category.general.system.image"><![CDATA[Grafik]]></item>
                <item name="wcf.acp.option.category.general.system"><![CDATA[System]]></item>
index 8422b42529632c7742ebb527dca2c9164af0252d..1641a50bf4ed22c6d876cd5b43dbf3e23c143e8e 100644 (file)
@@ -133,6 +133,7 @@ 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.RedisCacheSource"><![CDATA[Redis]]></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>
@@ -691,15 +692,20 @@ Examples for medium ID detection:
                <item name="wcf.acp.option.blacklist_user_agents.description"><![CDATA[One user-agent per line]]></item>
                <item name="wcf.acp.option.cache_source_memcached_host"><![CDATA[Memcached-Server]]></item>
                <item name="wcf.acp.option.cache_source_memcached_host.description"><![CDATA[One server per line, you can additionally specify a weight factor to allow load balancing, for example “localhost:11211:67” or “10.0.13.37:31337:33”.]]></item>
+               <item name="wcf.acp.option.cache_source_redis_host"><![CDATA[Redis-Server]]></item>
+               <item name="wcf.acp.option.cache_source_redis_host.description"><![CDATA[The server’s address, for example “localhost” or “10.0.13.37:1337”.]]></item>
                <item name="wcf.acp.option.cache_source_type"><![CDATA[Caching Method]]></item>
                <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.redis"><![CDATA[Redis]]></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>
                <item name="wcf.acp.option.category.general.cache.memcached"><![CDATA[Memcached]]></item>
                <item name="wcf.acp.option.category.general.cache.memcached.description"><![CDATA[Memcached uses the machine’s memory to store frequently accessed data, reducing database and filesystem load. Read more about Memcached on <a href="http://memcached.org/" class="externalURL">memcached.org</a>.]]></item>
+               <item name="wcf.acp.option.category.general.cache.redis"><![CDATA[Redis]]></item>
+               <item name="wcf.acp.option.category.general.cache.redis.description"><![CDATA[Redis uses the machine’s memory to store frequently accessed data, reducing database and filesystem load. Read more about Redis on <a href="http://redis.io/" class="externalURL">redis.io</a>.]]></item>
                <item name="wcf.acp.option.category.general.system.date"><![CDATA[Date &amp; Time]]></item>
                <item name="wcf.acp.option.category.general.system.image"><![CDATA[Graphics]]></item>
                <item name="wcf.acp.option.category.general.system"><![CDATA[System]]></item>