optional cache prefix for multiple tinyboard instances on one machine
This commit is contained in:
parent
a431994016
commit
e3f322e213
@ -17,6 +17,8 @@
|
|||||||
public static function get($key) {
|
public static function get($key) {
|
||||||
global $config, $debug;
|
global $config, $debug;
|
||||||
|
|
||||||
|
$key = $config['cache']['prefix'] . $key;
|
||||||
|
|
||||||
$data = false;
|
$data = false;
|
||||||
switch($config['cache']['enabled']) {
|
switch($config['cache']['enabled']) {
|
||||||
case 'memcached':
|
case 'memcached':
|
||||||
@ -45,6 +47,8 @@
|
|||||||
public static function set($key, $value, $expires = false) {
|
public static function set($key, $value, $expires = false) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
$key = $config['cache']['prefix'] . $key;
|
||||||
|
|
||||||
if(!$expires)
|
if(!$expires)
|
||||||
$expires = $config['cache']['timeout'];
|
$expires = $config['cache']['timeout'];
|
||||||
|
|
||||||
@ -68,6 +72,8 @@
|
|||||||
public static function delete($key) {
|
public static function delete($key) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
$key = $config['cache']['prefix'] . $key;
|
||||||
|
|
||||||
switch($config['cache']['enabled']) {
|
switch($config['cache']['enabled']) {
|
||||||
case 'memcached':
|
case 'memcached':
|
||||||
if(!self::$cache)
|
if(!self::$cache)
|
||||||
|
@ -120,6 +120,9 @@
|
|||||||
// Timeout for cached objects such as posts and HTML
|
// Timeout for cached objects such as posts and HTML
|
||||||
$config['cache']['timeout'] = 43200; // 12 hours
|
$config['cache']['timeout'] = 43200; // 12 hours
|
||||||
|
|
||||||
|
// Optional prefix if you're running multiple Tinyboard instances on the same machine
|
||||||
|
$config['cache']['prefix'] = '';
|
||||||
|
|
||||||
// Memcached servers to use - http://www.php.net/manual/en/memcached.addservers.php
|
// Memcached servers to use - http://www.php.net/manual/en/memcached.addservers.php
|
||||||
$config['cache']['memcached'] = Array(
|
$config['cache']['memcached'] = Array(
|
||||||
Array('localhost', 11211)
|
Array('localhost', 11211)
|
||||||
|
Loading…
Reference in New Issue
Block a user