mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-27 17:00:52 +01:00
Merge pull request #685 from Zankaria/remove-cache-backends
Remove cache backends
This commit is contained in:
commit
4e707ab9ae
@ -44,9 +44,7 @@ We try to make sure vichan is compatible with all major web servers. vichan does
|
||||
### Recommended
|
||||
1. MySQL/MariaDB server >= 5.5.3
|
||||
2. ImageMagick (command-line ImageMagick or GraphicsMagick preferred).
|
||||
3. ~~[APC (Alternative PHP Cache)](http://php.net/manual/en/book.apc.php)~~,
|
||||
[APCu (Alternative PHP Cache)](http://php.net/manual/en/book.apcu.php),
|
||||
[XCache](http://xcache.lighttpd.net/),
|
||||
3. [APCu (Alternative PHP Cache)](http://php.net/manual/en/book.apcu.php),
|
||||
[Memcached](http://www.php.net/manual/en/intro.memcached.php) or
|
||||
[Redis](https://redis.io/docs/about/)
|
||||
|
||||
|
@ -41,15 +41,9 @@ class Cache {
|
||||
self::init();
|
||||
$data = self::$cache->get($key);
|
||||
break;
|
||||
case 'apc':
|
||||
$data = apc_fetch($key);
|
||||
break;
|
||||
case 'apcu':
|
||||
$data = apcu_fetch($key);
|
||||
break;
|
||||
case 'xcache':
|
||||
$data = xcache_get($key);
|
||||
break;
|
||||
case 'php':
|
||||
$data = isset(self::$cache[$key]) ? self::$cache[$key] : false;
|
||||
break;
|
||||
@ -95,15 +89,9 @@ class Cache {
|
||||
self::init();
|
||||
self::$cache->setex($key, $expires, json_encode($value));
|
||||
break;
|
||||
case 'apc':
|
||||
apc_store($key, $value, $expires);
|
||||
break;
|
||||
case 'apcu':
|
||||
apcu_store($key, $value, $expires);
|
||||
break;
|
||||
case 'xcache':
|
||||
xcache_set($key, $value, $expires);
|
||||
break;
|
||||
case 'fs':
|
||||
$key = str_replace('/', '::', $key);
|
||||
$key = str_replace("\0", '', $key);
|
||||
@ -133,15 +121,9 @@ class Cache {
|
||||
self::init();
|
||||
self::$cache->del($key);
|
||||
break;
|
||||
case 'apc':
|
||||
apc_delete($key);
|
||||
break;
|
||||
case 'apcu':
|
||||
apcu_delete($key);
|
||||
break;
|
||||
case 'xcache':
|
||||
xcache_unset($key);
|
||||
break;
|
||||
case 'fs':
|
||||
$key = str_replace('/', '::', $key);
|
||||
$key = str_replace("\0", '', $key);
|
||||
@ -163,8 +145,6 @@ class Cache {
|
||||
if (!self::$cache)
|
||||
self::init();
|
||||
return self::$cache->flush();
|
||||
case 'apc':
|
||||
return apc_clear_cache('user');
|
||||
case 'apcu':
|
||||
return apcu_clear_cache('user');
|
||||
case 'php':
|
||||
|
@ -121,8 +121,7 @@
|
||||
*/
|
||||
|
||||
$config['cache']['enabled'] = 'php';
|
||||
// $config['cache']['enabled'] = 'xcache';
|
||||
// $config['cache']['enabled'] = 'apc';
|
||||
// $config['cache']['enabled'] = 'apcu';
|
||||
// $config['cache']['enabled'] = 'memcached';
|
||||
// $config['cache']['enabled'] = 'redis';
|
||||
// $config['cache']['enabled'] = 'fs';
|
||||
@ -1307,7 +1306,6 @@
|
||||
$config['file_mod_debug_antispam'] = 'mod/debug/antispam.html';
|
||||
$config['file_mod_debug_recent_posts'] = 'mod/debug/recent_posts.html';
|
||||
$config['file_mod_debug_sql'] = 'mod/debug/sql.html';
|
||||
$config['file_mod_debug_apc'] = 'mod/debug/apc.html';
|
||||
|
||||
// Board directory, followed by a forward-slash (/).
|
||||
$config['board_path'] = '%s/';
|
||||
@ -1708,8 +1706,6 @@
|
||||
$config['mod']['news_delete'] = ADMIN;
|
||||
// Execute un-filtered SQL queries on the database (?/debug/sql)
|
||||
$config['mod']['debug_sql'] = DISABLED;
|
||||
// Look through all cache values for debugging when APC is enabled (?/debug/apc)
|
||||
$config['mod']['debug_apc'] = ADMIN;
|
||||
// Edit the current configuration (via web interface)
|
||||
$config['mod']['edit_config'] = ADMIN;
|
||||
// View ban appeals
|
||||
|
@ -3001,25 +3001,3 @@ function mod_debug_sql() {
|
||||
|
||||
mod_page(_('Debug: SQL'), $config['file_mod_debug_sql'], $args);
|
||||
}
|
||||
|
||||
function mod_debug_apc() {
|
||||
global $config;
|
||||
|
||||
if (!hasPermission($config['mod']['debug_apc']))
|
||||
error($config['error']['noaccess']);
|
||||
|
||||
if ($config['cache']['enabled'] != 'apc')
|
||||
error('APC is not enabled.');
|
||||
|
||||
$cache_info = apc_cache_info('user');
|
||||
|
||||
// $cached_vars = new APCIterator('user', '/^' . $config['cache']['prefix'] . '/');
|
||||
$cached_vars = array();
|
||||
foreach ($cache_info['cache_list'] as $var) {
|
||||
if ($config['cache']['prefix'] != '' && strpos(isset($var['key']) ? $var['key'] : $var['info'], $config['cache']['prefix']) !== 0)
|
||||
continue;
|
||||
$cached_vars[] = $var;
|
||||
}
|
||||
|
||||
mod_page(_('Debug: APC'), $config['file_mod_debug_apc'], array('cached_vars' => $cached_vars));
|
||||
}
|
||||
|
@ -876,12 +876,10 @@ if ($step == 0) {
|
||||
),
|
||||
array(
|
||||
'category' => 'Misc',
|
||||
'name' => 'Caching available (APC(u), XCache, Memcached or Redis)',
|
||||
'result' => extension_loaded('apcu') || extension_loaded('apc') ||
|
||||
extension_loaded('xcache') || extension_loaded('memcached') ||
|
||||
extension_loaded('redis'),
|
||||
'name' => 'Caching available (APCu, Memcached or Redis)',
|
||||
'result' => extension_loaded('apcu') || extension_loaded('memcached') || 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. <a href="http://php.net/manual/en/book.apc.php">APC</a> is the recommended method of caching, but <a href="http://xcache.lighttpd.net/">XCache</a>, <a href="http://www.php.net/manual/en/intro.memcached.php">Memcached</a> and <a href="http://pecl.php.net/package/redis">Redis</a> are also supported.'
|
||||
'message' => 'You will not be able to enable the additional caching system, designed to minimize SQL queries and significantly improve performance. <a href="https://www.php.net/manual/en/book.apcu.php">APCu</a> is the recommended method of caching, but <a href="http://www.php.net/manual/en/intro.memcached.php">Memcached</a> and <a href="http://pecl.php.net/package/redis">Redis</a> are also supported.'
|
||||
),
|
||||
array(
|
||||
'category' => 'Misc',
|
||||
|
1
mod.php
1
mod.php
@ -96,7 +96,6 @@ $pages = array(
|
||||
// these pages aren't listed in the dashboard without $config['debug']
|
||||
//'/debug/antispam' => 'debug_antispam',
|
||||
//'/debug/recent' => 'debug_recent_posts',
|
||||
//'/debug/apc' => 'debug_apc',
|
||||
//'/debug/sql' => 'secure_POST debug_sql',
|
||||
|
||||
// This should always be at the end:
|
||||
|
Loading…
Reference in New Issue
Block a user