File tree Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -92,19 +92,17 @@ public function contents()
92
92
throw new ArchiveIOException ('Can not read from a closed archive ' );
93
93
}
94
94
95
- $ result = array ();
96
95
while ($ read = $ this ->readbytes (512 )) {
97
96
$ header = $ this ->parseHeader ($ read );
98
97
if (!is_array ($ header )) {
99
98
continue ;
100
99
}
101
100
102
101
$ this ->skipbytes (ceil ($ header ['size ' ] / 512 ) * 512 );
103
- $ result [] = $ this ->header2fileinfo ($ header );
102
+ yield $ this ->header2fileinfo ($ header );
104
103
}
105
104
106
105
$ this ->close ();
107
- return $ result ;
108
106
}
109
107
110
108
/**
Original file line number Diff line number Diff line change @@ -77,19 +77,16 @@ public function contents()
77
77
throw new ArchiveIOException ('Can not read from a closed archive ' );
78
78
}
79
79
80
- $ result = array ();
81
-
82
80
$ centd = $ this ->readCentralDir ();
83
81
84
82
@rewind ($ this ->fh );
85
83
@fseek ($ this ->fh , $ centd ['offset ' ]);
86
84
87
85
for ($ i = 0 ; $ i < $ centd ['entries ' ]; $ i ++) {
88
- $ result [] = $ this ->header2fileinfo ($ this ->readCentralFileHeader ());
86
+ yield $ this ->header2fileinfo ($ this ->readCentralFileHeader ());
89
87
}
90
88
91
89
$ this ->close ();
92
- return $ result ;
93
90
}
94
91
95
92
/**
You can’t perform that action at this time.
0 commit comments