remove APC completely
authorStricted <info@stricted.de>
Sun, 5 Jan 2014 04:14:54 +0000 (05:14 +0100)
committerStricted <info@stricted.de>
Sun, 5 Jan 2014 04:15:53 +0000 (05:15 +0100)
com.woltlab.wcf/option.xml
wcfsetup/install/files/lib/acp/page/CacheListPage.class.php
wcfsetup/install/files/lib/system/cache/source/ApcCacheSource.class.php [deleted file]
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index b9053f60d4bfa610e44ed32941f80b659c2c0219..1a4ecac6932dfb7d91fe2e00d017bdc5d644e2fe 100644 (file)
@@ -651,11 +651,9 @@ debug:mail_debug_logfile_path,!mail_use_f_param,!mail_smtp_host,!mail_smtp_port,
                                <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>
-                               <!-- apc:wcf.acp.option.cache_source_type.apc -->
                                <enableoptions><![CDATA[disk:!cache_source_memcached_host
 memcached:cache_source_memcached_host
 no:!cache_source_memcached_host]]></enableoptions>
-                               <!-- apc:!cache_source_memcached_host -->
                        </option>
                        
                        <option name="cache_source_memcached_host">
index e21f8de4b9f39a52e0b2bcf0f9a9cb3a89f7e961..991e727904d25ce206a724891ab0c77580148c45 100755 (executable)
@@ -83,32 +83,6 @@ class CacheListPage extends AbstractPage {
                                $this->cacheData['version'] = WCF_VERSION;
                        break;
                        
-                       case 'wcf\system\cache\source\ApcCacheSource':
-                               // set version
-                               $this->cacheData['version'] = phpversion('apc');
-                               
-                               $apcinfo = apc_cache_info('user');
-                               $cacheList = $apcinfo['cache_list'];
-                               usort($cacheList, function ($a, $b) {
-                                       return $a['info'] > $b['info'];
-                               });
-                               
-                               $prefix = new Regex('^WCF_'.substr(sha1(WCF_DIR), 0, 10) . '_');
-                               foreach ($cacheList as $cache) {
-                                       if (!$prefix->match($cache['info'])) continue;
-                                       
-                                       // get additional cache information
-                                       $this->caches['data']['apc'][] = array(
-                                               'filename' => $prefix->replace($cache['info'], ''),
-                                               'filesize' => $cache['mem_size'],
-                                               'mtime' => $cache['mtime']
-                                       );
-                                       
-                                       $this->cacheData['files']++;
-                                       $this->cacheData['size'] += $cache['mem_size'];
-                               }
-                       break;
-                       
                        case 'wcf\system\cache\source\NoCacheSource':
                                $this->cacheData['version'] = WCF_VERSION;
                        break;
diff --git a/wcfsetup/install/files/lib/system/cache/source/ApcCacheSource.class.php b/wcfsetup/install/files/lib/system/cache/source/ApcCacheSource.class.php
deleted file mode 100644 (file)
index 28f0d17..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<?php
-namespace wcf\system\cache\source;
-use wcf\system\exception\SystemException;
-use wcf\system\Regex;
-use wcf\util\StringUtil;
-
-/**
- * ApcCacheSource is an implementation of CacheSource that uses APC to store cached variables.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2013 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 ApcCacheSource implements ICacheSource {
-       /**
-        * key prefix
-        * @var string
-        */
-       protected $prefix = '';
-       
-       /**
-        * Creates a new ApcCacheSource object.
-        */
-       public function __construct() {
-               if (!function_exists('apc_store')) {
-                       throw new SystemException('APC support is not enabled.');
-               }
-               
-               // set variable prefix to prevent collision
-               $this->prefix = 'WCF_'.substr(sha1(WCF_DIR), 0, 10) . '_';
-       }
-       
-       /**
-        * @see \wcf\system\cache\source\ICacheSource::flush()
-        */
-       public function flush($cacheName, $useWildcard) {
-               if ($useWildcard) {
-                       $this->removeKeys($this->prefix . $cacheName . '(\-[a-f0-9]+)?');
-               }
-               else {
-                       apc_delete($this->prefix . $cacheName);
-               }
-       }
-       
-       /**
-        * @see \wcf\system\cache\source\ICacheSource::flushAll()
-        */
-       public function flushAll() {
-               $this->removeKeys();
-       }
-       
-       /**
-        * @see \wcf\system\cache\source\ICacheSource::get()
-        */
-       public function get($cacheName, $maxLifetime) {
-               if (($data = apc_fetch($this->prefix . $cacheName)) === false) {
-                       return null;
-               }
-               
-               return $data;
-       }
-       
-       /**
-        * @see \wcf\system\cache\source\ICacheSource::set()
-        */
-       public function set($cacheName, $value, $maxLifetime) {
-               apc_store($this->prefix . $cacheName, $value, $this->getTTL($maxLifetime));
-       }
-       
-       /**
-        * Returns time to live in seconds, defaults to 3 days.
-        * 
-        * @param       integer         $maxLifetime
-        * @return      integer
-        */
-       protected function getTTL($maxLifetime = 0) {
-               if ($maxLifetime) {
-                       // max lifetime is a timestamp, discard (similar to http://www.php.net/manual/en/memcached.expiration.php)
-                       if ($maxLifetime > (60 * 60 * 24 * 30)) {
-                               $maxLifetime = 0;
-                       }
-               }
-               
-               if ($maxLifetime) {
-                       return $maxLifetime;
-               }
-               
-               // default TTL: 3 days
-               return (60 * 60 * 24 * 3);
-       }
-       
-       /**
-        * @see \wcf\system\cache\source\ICacheSource::clear()
-        */
-       public function removeKeys($pattern = null) {
-               $regex = null;
-               if ($pattern !== null) {
-                       $regex = new Regex('^'.$pattern.'$');
-               }
-               
-               $apcCacheInfo = apc_cache_info('user');
-               foreach ($apcCacheInfo['cache_list'] as $cache) {
-                       if ($regex === null) {
-                               if (StringUtil::startsWith($cache['info'], $this->prefix)) {
-                                       apc_delete($cache['info']);
-                               }
-                       }
-                       else if ($regex->match($cache['info'])) {
-                               apc_delete($cache['info']);
-                       }
-               }
-       }
-}
index e6e92510ee129e566142357b3217e182b727ad6c..cdb9ea51127c997d8e5a3055f25a7743bc071d8d 100644 (file)
                <item name="wcf.acp.cache.list.name"><![CDATA[Name]]></item>
                <item name="wcf.acp.cache.list.perm"><![CDATA[Zugriffsrechte]]></item>
                <item name="wcf.acp.cache.list.size"><![CDATA[Größe]]></item>
-               <item name="wcf.acp.cache.source.type.ApcCacheSource"><![CDATA[Alternative PHP Cache]]></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.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_type"><![CDATA[Cache-Methode]]></item>
-               <item name="wcf.acp.option.cache_source_type.apc"><![CDATA[Alternative PHP Cache (experimentell)]]></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>
index bd5ae35375c9c9bba8d80f530664a3857ca67690..c13f794de19fe10262b7a850d8112f8428ab1c19 100644 (file)
@@ -103,7 +103,6 @@ Examples for medium ID detection:
                <item name="wcf.acp.cache.list.name"><![CDATA[Name]]></item>
                <item name="wcf.acp.cache.list.perm"><![CDATA[Permissions]]></item>
                <item name="wcf.acp.cache.list.size"><![CDATA[Size]]></item>
-               <item name="wcf.acp.cache.source.type.ApcCacheSource"><![CDATA[Alternative PHP Cache]]></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>
@@ -572,7 +571,6 @@ Examples for medium ID detection:
                <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_type"><![CDATA[Caching Method]]></item>
-               <item name="wcf.acp.option.cache_source_type.apc"><![CDATA[Alternative PHP Cache (experimental)]]></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>