]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/file_directories/io_stream/class_FileIoStream.php
Continued:
[core.git] / framework / main / classes / file_directories / io_stream / class_FileIoStream.php
index 6c793b84b6e12f7306a09c6975c2a51998f3ed9e..551791f3b33f321a4d39753d93ae3e825012988b 100644 (file)
@@ -101,7 +101,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                                // Bail out
                                ApplicationEntryPoint::exitApplication('The application has made a fatal error. Exception: ' . $e->__toString() . ' with message: ' . $e->getMessage());
                        }
-               } // END - for
+               }
 
                // Write a header information for validation purposes
                $fileInstance->writeToFile(sprintf('%s%s%s%s%s%s%s%s%s' . PHP_EOL,
@@ -136,7 +136,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
 
                        // Advance to the next 50-chars block
                        $idx += 50;
-               } // END - while
+               }
 
                // Close the file
                unset($fileInstance);
@@ -168,11 +168,11 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                        // Break infinite loop maybe caused by the input handler
                        if ($lastBuffer == $inputBuffer) {
                                break;
-                       } // END - if
+                       }
 
                        // Remember last read line for avoiding possible infinite loops
                        $lastBuffer = $inputBuffer;
-               } // END - while
+               }
 
                // Close directory handle
                unset($fileInstance);
@@ -198,7 +198,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                                if (count($header) != 4) {
                                        // Throw an exception
                                        throw new InvalidArrayCountException(array($this, 'header', count($header), 4), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
-                               } // END - if
+                               }
                        } elseif (substr($rawLine, 0, 5) == self::FILE_IO_DATA_BLOCK_ID) {
                                // Is a data line!
                                $data = explode(self::FILE_IO_SEPARATOR, $rawLine);
@@ -212,7 +212,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                                        if (md5($data[0]) != $data[1]) {
                                                // MD5 hash did not match!
                                                throw new InvalidMD5ChecksumException(array($this, md5($data[0]), $data[1]), self::EXCEPTION_MD5_CHECKSUMS_MISMATCH);
-                                       } // END - if
+                                       }
                                } else {
                                        // Invalid count!
                                        throw new InvalidArrayCountException(array($this, 'data', count($data), 2), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
@@ -224,19 +224,19 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                                // Other raw lines than header/data tagged lines and re-add the new-line char
                                $readData .= $rawLine . PHP_EOL;
                        }
-               } // END - foreach
+               }
 
                // Was raw lines read and no header/data?
                if ((!empty($readData)) && (count($header) == 0) && (count($data) == 0)) {
                        // Return raw lines back
                        return $readData;
-               } // END - if
+               }
 
                // Was a header found?
                if (count($header) != 4) {
                        // Throw an exception
                        throw new InvalidArrayCountException(array($this, 'header', count($header), 4), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
-               } // END - if
+               }
 
                // Decode all from Base64
                $readData = @base64_decode($readData);
@@ -245,13 +245,13 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                if (strlen($readData) != $header[2]) {
                        // Size did not match
                        throw new InvalidDataLengthException(array($this, strlen($readData), $header[2]), self::EXCEPTION_UNEXPECTED_STRING_SIZE);
-               } // END - if
+               }
 
                // Validate the decoded data with the final MD5 hash
                if (md5($readData) != $header[3]) {
                        // MD5 hash did not match!
                        throw new InvalidMD5ChecksumException(array($this, md5($readData), $header[3]), self::EXCEPTION_MD5_CHECKSUMS_MISMATCH);
-               } // END - if
+               }
 
                // Return all in an array
                return array(