Completed
Push — 2.2 ( 7184e8...1364eb )
by Huberty
03:43
created
src/FileCache.php 2 patches
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.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
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
 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
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
 block discarded – undo
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
 		
Please login to merge, or discard this patch.