@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | function getInstance() |
| 25 | 25 | {
|
| 26 | - if(!$GLOBALS['__CacheFile__']) |
|
| 26 | + if (!$GLOBALS['__CacheFile__']) |
|
| 27 | 27 | {
|
| 28 | 28 | $GLOBALS['__CacheFile__'] = new CacheFile(); |
| 29 | 29 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | function CacheFile() |
| 39 | 39 | {
|
| 40 | - $this->cache_dir = _XE_PATH_ . $this->cache_dir; |
|
| 40 | + $this->cache_dir = _XE_PATH_.$this->cache_dir; |
|
| 41 | 41 | FileHandler::makeDir($this->cache_dir); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | function getCacheFileName($key) |
| 51 | 51 | {
|
| 52 | - return $this->cache_dir . str_replace(':', DIRECTORY_SEPARATOR, $key) . '.php';
|
|
| 52 | + return $this->cache_dir.str_replace(':', DIRECTORY_SEPARATOR, $key).'.php';
|
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | $content = array(); |
| 77 | 77 | $content[] = '<?php'; |
| 78 | 78 | $content[] = 'if(!defined(\'__XE__\')) { exit(); }';
|
| 79 | - $content[] = 'return \'' . addslashes(serialize($obj)) . '\';'; |
|
| 79 | + $content[] = 'return \''.addslashes(serialize($obj)).'\';'; |
|
| 80 | 80 | FileHandler::writeFile($cache_file, implode(PHP_EOL, $content)); |
| 81 | - if(function_exists('opcache_invalidate'))
|
|
| 81 | + if (function_exists('opcache_invalidate'))
|
|
| 82 | 82 | {
|
| 83 | 83 | @opcache_invalidate($cache_file, true); |
| 84 | 84 | } |
@@ -95,9 +95,9 @@ discard block |
||
| 95 | 95 | {
|
| 96 | 96 | $cache_file = $this->getCacheFileName($key); |
| 97 | 97 | |
| 98 | - if(file_exists($cache_file)) |
|
| 98 | + if (file_exists($cache_file)) |
|
| 99 | 99 | {
|
| 100 | - if($modified_time > 0 && filemtime($cache_file) < $modified_time) |
|
| 100 | + if ($modified_time > 0 && filemtime($cache_file) < $modified_time) |
|
| 101 | 101 | {
|
| 102 | 102 | FileHandler::removeFile($cache_file); |
| 103 | 103 | return false; |
@@ -118,12 +118,12 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | function get($key, $modified_time = 0) |
| 120 | 120 | {
|
| 121 | - if(!$cache_file = FileHandler::exists($this->getCacheFileName($key))) |
|
| 121 | + if (!$cache_file = FileHandler::exists($this->getCacheFileName($key))) |
|
| 122 | 122 | {
|
| 123 | 123 | return false; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - if($modified_time > 0 && filemtime($cache_file) < $modified_time) |
|
| 126 | + if ($modified_time > 0 && filemtime($cache_file) < $modified_time) |
|
| 127 | 127 | {
|
| 128 | 128 | FileHandler::removeFile($cache_file); |
| 129 | 129 | return false; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | function _delete($_key) |
| 144 | 144 | {
|
| 145 | 145 | $cache_file = $this->getCacheFileName($_key); |
| 146 | - if(function_exists('opcache_invalidate'))
|
|
| 146 | + if (function_exists('opcache_invalidate'))
|
|
| 147 | 147 | {
|
| 148 | 148 | @opcache_invalidate($cache_file, true); |
| 149 | 149 | } |