From 75d310786c43cc4399e20abe08f4cd68275dbcd5 Mon Sep 17 00:00:00 2001 From: Daniel Saunders Date: Thu, 1 Mar 2018 04:32:13 -0500 Subject: [PATCH] Removed Memcached support due to security concerns. --- README.md | 2 +- inc/cache.php | 19 ------------------- inc/config.php | 6 ------ install.php | 6 +++--- 4 files changed, 4 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 0070ac6c..029908fb 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ it need one. 2. ImageMagick (command-line ImageMagick or GraphicsMagick preferred). 3. [APC (Alternative PHP Cache)](http://php.net/manual/en/book.apc.php), [XCache](http://xcache.lighttpd.net/) or - [Memcached](http://www.php.net/manual/en/intro.memcached.php) + [Redis](http://pecl.php.net/package/redis) Contributing ------------ diff --git a/inc/cache.php b/inc/cache.php index 852aefa2..87bf9d01 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -12,10 +12,6 @@ class Cache { global $config; switch ($config['cache']['enabled']) { - case 'memcached': - self::$cache = new Memcached(); - self::$cache->addServers($config['cache']['memcached']); - break; case 'redis': self::$cache = new Redis(); self::$cache->connect($config['cache']['redis'][0], $config['cache']['redis'][1]); @@ -36,11 +32,6 @@ class Cache { $data = false; switch ($config['cache']['enabled']) { - case 'memcached': - if (!self::$cache) - self::init(); - $data = self::$cache->get($key); - break; case 'apc': $data = apc_fetch($key); break; @@ -82,11 +73,6 @@ class Cache { $expires = $config['cache']['timeout']; switch ($config['cache']['enabled']) { - case 'memcached': - if (!self::$cache) - self::init(); - self::$cache->set($key, $value, $expires); - break; case 'redis': if (!self::$cache) self::init(); @@ -117,7 +103,6 @@ class Cache { $key = $config['cache']['prefix'] . $key; switch ($config['cache']['enabled']) { - case 'memcached': case 'redis': if (!self::$cache) self::init(); @@ -146,10 +131,6 @@ class Cache { global $config; switch ($config['cache']['enabled']) { - case 'memcached': - if (!self::$cache) - self::init(); - return self::$cache->flush(); case 'apc': return apc_clear_cache('user'); case 'php': diff --git a/inc/config.php b/inc/config.php index 1ebc0b26..5f5bbd6d 100644 --- a/inc/config.php +++ b/inc/config.php @@ -118,7 +118,6 @@ $config['cache']['enabled'] = 'php'; // $config['cache']['enabled'] = 'xcache'; // $config['cache']['enabled'] = 'apc'; - // $config['cache']['enabled'] = 'memcached'; // $config['cache']['enabled'] = 'redis'; // $config['cache']['enabled'] = 'fs'; @@ -128,11 +127,6 @@ // Optional prefix if you're running multiple Tinyboard instances on the same machine. $config['cache']['prefix'] = ''; - // Memcached servers to use. Read more: http://www.php.net/manual/en/memcached.addservers.php - $config['cache']['memcached'] = array( - array('localhost', 11211) - ); - // Redis server to use. Location, port, password, database id. // Note that Tinyboard may clear the database at times, so you may want to pick a database id just for // Tinyboard to use. diff --git a/install.php b/install.php index 1ac88571..899954b8 100644 --- a/install.php +++ b/install.php @@ -876,11 +876,11 @@ if ($step == 0) { ), array( 'category' => 'Misc', - 'name' => 'Caching available (APC, XCache, Memcached or Redis)', + 'name' => 'Caching available (APC, XCache, or Redis)', 'result' => extension_loaded('apc') || extension_loaded('xcache') - || extension_loaded('memcached') || extension_loaded('redis'), + || extension_loaded('redis'), 'required' => false, - 'message' => 'You will not be able to enable the additional caching system, designed to minimize SQL queries and significantly improve performance. APC is the recommended method of caching, but XCache, Memcached and Redis are also supported.' + 'message' => 'You will not be able to enable the additional caching system, designed to minimize SQL queries and significantly improve performance. APC is the recommended method of caching, but XCache, and Redis are also supported.' ), array( 'category' => 'Misc',