1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

Add support for APC(u)

This commit is contained in:
Fred Brennan 2022-08-29 11:45:59 -04:00
parent ae2d91c534
commit a99d7c7c80
2 changed files with 14 additions and 2 deletions

View File

@ -39,12 +39,13 @@ Requirements
5. [PHP PDO](http://www.php.net/manual/en/intro.pdo.php) 5. [PHP PDO](http://www.php.net/manual/en/intro.pdo.php)
6. A Unix-like OS, preferrably FreeBSD or Linux 6. A Unix-like OS, preferrably FreeBSD or Linux
We try to make sure vichan is compatible with all major web servers. vichan does not include an Apache ```.htaccess``` file nor does it need one. We try to make sure vichan is compatible with all major web servers. vichan does not include an Apache `.htaccess` file nor does it need one.
### Recommended ### Recommended
1. MySQL/MariaDB server >= 5.5.3 1. MySQL/MariaDB server >= 5.5.3
2. ImageMagick (command-line ImageMagick or GraphicsMagick preferred). 2. ImageMagick (command-line ImageMagick or GraphicsMagick preferred).
3. [APC (Alternative PHP Cache)](http://php.net/manual/en/book.apc.php), 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/), [XCache](http://xcache.lighttpd.net/),
[Memcached](http://www.php.net/manual/en/intro.memcached.php) or [Memcached](http://www.php.net/manual/en/intro.memcached.php) or
[Redis](https://redis.io/docs/about/) [Redis](https://redis.io/docs/about/)

View File

@ -44,6 +44,9 @@ class Cache {
case 'apc': case 'apc':
$data = apc_fetch($key); $data = apc_fetch($key);
break; break;
case 'apcu':
$data = apcu_fetch($key);
break;
case 'xcache': case 'xcache':
$data = xcache_get($key); $data = xcache_get($key);
break; break;
@ -95,6 +98,9 @@ class Cache {
case 'apc': case 'apc':
apc_store($key, $value, $expires); apc_store($key, $value, $expires);
break; break;
case 'apcu':
apcu_store($key, $value, $expires);
break;
case 'xcache': case 'xcache':
xcache_set($key, $value, $expires); xcache_set($key, $value, $expires);
break; break;
@ -130,6 +136,9 @@ class Cache {
case 'apc': case 'apc':
apc_delete($key); apc_delete($key);
break; break;
case 'apcu':
apcu_delete($key);
break;
case 'xcache': case 'xcache':
xcache_unset($key); xcache_unset($key);
break; break;
@ -156,6 +165,8 @@ class Cache {
return self::$cache->flush(); return self::$cache->flush();
case 'apc': case 'apc':
return apc_clear_cache('user'); return apc_clear_cache('user');
case 'apcu':
return apcu_clear_cache('user');
case 'php': case 'php':
self::$cache = array(); self::$cache = array();
break; break;