Completed
Pull Request — 2.2 (#7)
by Kevin
02:31
created
src/FileCache.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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() {
Please login to merge, or discard this patch.