forked from leftypol/leftypol
optional cache prefix for multiple tinyboard instances on one machine
This commit is contained in:
parent
a431994016
commit
e3f322e213
2 changed files with 9 additions and 0 deletions
|
@ -17,6 +17,8 @@
|
|||
public static function get($key) {
|
||||
global $config, $debug;
|
||||
|
||||
$key = $config['cache']['prefix'] . $key;
|
||||
|
||||
$data = false;
|
||||
switch($config['cache']['enabled']) {
|
||||
case 'memcached':
|
||||
|
@ -45,6 +47,8 @@
|
|||
public static function set($key, $value, $expires = false) {
|
||||
global $config;
|
||||
|
||||
$key = $config['cache']['prefix'] . $key;
|
||||
|
||||
if(!$expires)
|
||||
$expires = $config['cache']['timeout'];
|
||||
|
||||
|
@ -68,6 +72,8 @@
|
|||
public static function delete($key) {
|
||||
global $config;
|
||||
|
||||
$key = $config['cache']['prefix'] . $key;
|
||||
|
||||
switch($config['cache']['enabled']) {
|
||||
case 'memcached':
|
||||
if(!self::$cache)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue