diff options
| author | Michael Save <savetheinternet@tinyboard.org> | 2012-04-13 00:18:19 +1000 |
|---|---|---|
| committer | Michael Save <savetheinternet@tinyboard.org> | 2012-04-13 00:18:19 +1000 |
| commit | 51675e7a9bf4d5055ed45b37bac964f788800399 (patch) | |
| tree | 3df1b07b09315b184556a4418d2102e095c26cdd /inc/cache.php | |
| parent | da52307c67818893cb7ee54d8e2d6c93c0e34a02 (diff) | |
code cleanup
Diffstat (limited to 'inc/cache.php')
| -rw-r--r-- | inc/cache.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/inc/cache.php b/inc/cache.php index e29b282d..19e6b356 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -4,7 +4,7 @@ * Copyright (c) 2010-2012 Tinyboard Development Group */ -if(realpath($_SERVER['SCRIPT_FILENAME']) == str_replace('\\', '/', __FILE__)) { +if (realpath($_SERVER['SCRIPT_FILENAME']) == str_replace('\\', '/', __FILE__)) { // You cannot request this file directly. exit; } @@ -14,7 +14,7 @@ class Cache { public static function init() { global $config; - switch($config['cache']['enabled']) { + switch ($config['cache']['enabled']) { case 'memcached': self::$cache = new Memcached(); self::$cache->addServers($config['cache']['memcached']); @@ -30,9 +30,9 @@ class Cache { $key = $config['cache']['prefix'] . $key; $data = false; - switch($config['cache']['enabled']) { + switch ($config['cache']['enabled']) { case 'memcached': - if(!self::$cache) + if (!self::$cache) self::init(); $data = self::$cache->get($key); break; @@ -48,7 +48,7 @@ class Cache { } // debug - if($data && $config['debug']) { + if ($data && $config['debug']) { $debug['cached'][] = $key; } @@ -59,12 +59,12 @@ class Cache { $key = $config['cache']['prefix'] . $key; - if(!$expires) + if (!$expires) $expires = $config['cache']['timeout']; - switch($config['cache']['enabled']) { + switch ($config['cache']['enabled']) { case 'memcached': - if(!self::$cache) + if (!self::$cache) self::init(); self::$cache->set($key, $value, $expires); break; @@ -84,9 +84,9 @@ class Cache { $key = $config['cache']['prefix'] . $key; - switch($config['cache']['enabled']) { + switch ($config['cache']['enabled']) { case 'memcached': - if(!self::$cache) + if (!self::$cache) self::init(); self::$cache->delete($key); break; @@ -104,9 +104,9 @@ class Cache { public static function flush() { global $config; - switch($config['cache']['enabled']) { + switch ($config['cache']['enabled']) { case 'memcached': - if(!self::$cache) + if (!self::$cache) self::init(); return self::$cache->flush(); case 'apc': |
