File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -75,14 +75,12 @@ private function readNextRecord()
7575
7676 $ isInRecord = false ;
7777 $ recording = '' ;
78- $ lastChar = null ;
7978
80- while (false !== ($ char = fgetc ($ this ->handle ))) {
81- $ isNewArrayStart = ($ char === '- ' ) && ($ lastChar === "\n" || $ lastChar === null );
82- $ lastChar = $ char ;
79+ while (false !== ($ line = fgets ($ this ->handle ))) {
80+ $ isNewArrayStart = strpos ($ line , '- ' ) === 0 ;
8381
8482 if ($ isInRecord && $ isNewArrayStart ) {
85- fseek ($ this ->handle , -1 , SEEK_CUR );
83+ fseek ($ this ->handle , -strlen ( $ line ) , SEEK_CUR );
8684 break ;
8785 }
8886
@@ -91,11 +89,11 @@ private function readNextRecord()
9189 }
9290
9391 if ($ isInRecord ) {
94- $ recording .= $ char ;
92+ $ recording .= $ line ;
9593 }
9694 }
9795
98- if ($ char == false ) {
96+ if ($ line == false ) {
9997 $ this ->isEOF = true ;
10098 }
10199
You can’t perform that action at this time.
0 commit comments