@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if (empty($this->options['path'])) { |
| 46 | - $this->options['path'] = Container::get('app')->getRuntimePath() . 'cache' . DIRECTORY_SEPARATOR; |
|
| 46 | + $this->options['path'] = Container::get('app')->getRuntimePath().'cache'.DIRECTORY_SEPARATOR; |
|
| 47 | 47 | } elseif (substr($this->options['path'], -1) != DIRECTORY_SEPARATOR) { |
| 48 | 48 | $this->options['path'] .= DIRECTORY_SEPARATOR; |
| 49 | 49 | } |
@@ -82,14 +82,14 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | if ($this->options['cache_subdir']) { |
| 84 | 84 | // 使用子目录 |
| 85 | - $name = substr($name, 0, 2) . DIRECTORY_SEPARATOR . substr($name, 2); |
|
| 85 | + $name = substr($name, 0, 2).DIRECTORY_SEPARATOR.substr($name, 2); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | if ($this->options['prefix']) { |
| 89 | - $name = $this->options['prefix'] . DIRECTORY_SEPARATOR . $name; |
|
| 89 | + $name = $this->options['prefix'].DIRECTORY_SEPARATOR.$name; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - $filename = $this->options['path'] . $name . '.php'; |
|
| 92 | + $filename = $this->options['path'].$name.'.php'; |
|
| 93 | 93 | $dir = dirname($filename); |
| 94 | 94 | |
| 95 | 95 | if ($auto && !is_dir($dir)) { |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $data = gzcompress($data, 3); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - $data = "<?php\n//" . sprintf('%012d', $expire) . "\n exit();?>\n" . $data; |
|
| 187 | + $data = "<?php\n//".sprintf('%012d', $expire)."\n exit();?>\n".$data; |
|
| 188 | 188 | $result = file_put_contents($filename, $data); |
| 189 | 189 | |
| 190 | 190 | if ($result) { |
@@ -272,13 +272,13 @@ discard block |
||
| 272 | 272 | |
| 273 | 273 | $this->writeTimes++; |
| 274 | 274 | |
| 275 | - $files = (array) glob($this->options['path'] . ($this->options['prefix'] ? $this->options['prefix'] . DIRECTORY_SEPARATOR : '') . '*'); |
|
| 275 | + $files = (array) glob($this->options['path'].($this->options['prefix'] ? $this->options['prefix'].DIRECTORY_SEPARATOR : '').'*'); |
|
| 276 | 276 | |
| 277 | 277 | foreach ($files as $path) { |
| 278 | 278 | if (is_dir($path)) { |
| 279 | - $matches = glob($path . DIRECTORY_SEPARATOR . '*.php'); |
|
| 279 | + $matches = glob($path.DIRECTORY_SEPARATOR.'*.php'); |
|
| 280 | 280 | if (is_array($matches)) { |
| 281 | - array_map(function ($v) { |
|
| 281 | + array_map(function($v) { |
|
| 282 | 282 | $this->unlink($v); |
| 283 | 283 | }, $matches); |
| 284 | 284 | } |