@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | $filename = $this->getFileName($key); |
67 | 67 | |
68 | 68 | if (is_readable($filename)) { |
69 | - $fp = fopen($filename, "r"); |
|
70 | - if ($fp === false) {//File may have been deleted between is_readable and fopen |
|
71 | - return null; |
|
72 | - } |
|
73 | - $timeout = fgets($fp); |
|
69 | + $fp = fopen($filename, "r"); |
|
70 | + if ($fp === false) {//File may have been deleted between is_readable and fopen |
|
71 | + return null; |
|
72 | + } |
|
73 | + $timeout = fgets($fp); |
|
74 | 74 | |
75 | 75 | if ($timeout > time() || $timeout==0) { |
76 | 76 | $contents = ""; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
133 | - $oldUmask = umask(0); |
|
133 | + $oldUmask = umask(0); |
|
134 | 134 | |
135 | 135 | if (!is_writable($filename)) { |
136 | 136 | if (!file_exists($this->getDirectory())) { |
@@ -152,10 +152,10 @@ discard block |
||
152 | 152 | fwrite($fp, $timeOut."\n"); |
153 | 153 | fwrite($fp, serialize($value)); |
154 | 154 | fclose($fp); |
155 | - // Cache is shared with group, not with the rest of the world. |
|
156 | - chmod($filename, 0660); |
|
155 | + // Cache is shared with group, not with the rest of the world. |
|
156 | + chmod($filename, 0660); |
|
157 | 157 | |
158 | - umask($oldUmask); |
|
158 | + umask($oldUmask); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -190,14 +190,14 @@ discard block |
||
190 | 190 | } |
191 | 191 | } |
192 | 192 | $files = glob($this->getDirectory()."*"); |
193 | - if (false !== $files){// some file systems wont distinguish between empty match and an error |
|
194 | - $prefixFile = str_replace(array("_", "/", "\\", ":"), array("___", "_s_", "_b_", "_d_"), $this->prefix); |
|
195 | - foreach ($files as $filename) { |
|
196 | - if (empty($prefixFile) || strpos(basename($filename), $prefixFile) === 0) { |
|
197 | - unlink($filename); |
|
198 | - } |
|
199 | - } |
|
200 | - } |
|
193 | + if (false !== $files){// some file systems wont distinguish between empty match and an error |
|
194 | + $prefixFile = str_replace(array("_", "/", "\\", ":"), array("___", "_s_", "_b_", "_d_"), $this->prefix); |
|
195 | + foreach ($files as $filename) { |
|
196 | + if (empty($prefixFile) || strpos(basename($filename), $prefixFile) === 0) { |
|
197 | + unlink($filename); |
|
198 | + } |
|
199 | + } |
|
200 | + } |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | protected function getDirectory() { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | $timeout = fgets($fp); |
74 | 74 | |
75 | - if ($timeout > time() || $timeout==0) { |
|
75 | + if ($timeout > time() || $timeout == 0) { |
|
76 | 76 | $contents = ""; |
77 | 77 | while (!feof($fp)) { |
78 | 78 | $contents .= fread($fp, 65536); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | } |
191 | 191 | } |
192 | 192 | $files = glob($this->getDirectory()."*"); |
193 | - if (false !== $files){// some file systems wont distinguish between empty match and an error |
|
193 | + if (false !== $files) {// some file systems wont distinguish between empty match and an error |
|
194 | 194 | $prefixFile = str_replace(array("_", "/", "\\", ":"), array("___", "_s_", "_b_", "_d_"), $this->prefix); |
195 | 195 | foreach ($files as $filename) { |
196 | 196 | if (empty($prefixFile) || strpos(basename($filename), $prefixFile) === 0) { |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $fullPath = $this->getDirectory().$key.".cache"; |
223 | 223 | |
224 | 224 | // Approximative value due to NTFS short file names (e.g. PROGRA~1) that get longer when evaluated by Windows |
225 | - if (strlen($fullPath)<160) { |
|
225 | + if (strlen($fullPath) < 160) { |
|
226 | 226 | return $fullPath; |
227 | 227 | } |
228 | 228 |