File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,17 @@ public function readDir(string $path): array
126
126
foreach ((clone $ finder )->sortByName ()->directories () as $ directory ) {
127
127
$ data ['dirs ' ][] = new DirObject ($ directory , $ this ->getRelativePath ($ directory ->getRealPath ()));
128
128
}
129
- foreach ((clone $ finder )->sortByModifiedTime ()->reverseSorting ()->files ()->name ($ this ->logExtensions ) as $ file ) {
129
+
130
+ // for finder > 4.4 use: (clone $finder)->sortByModifiedTime()->reverseSorting()->files()->name($this->logExtensions)
131
+ $ finder = (clone $ finder )->sortByModifiedTime ()->files ();
132
+ foreach ($ this ->logExtensions as $ extension ) {
133
+ $ finder ->name ($ extension );
134
+ }
135
+ foreach ($ finder as $ file ) {
130
136
$ data ['files ' ][] = new FileObject ($ file , $ this ->getRelativePath ($ file ->getRealPath ()));
131
137
}
138
+ $ data ['files ' ] = array_reverse ($ data ['files ' ]);
139
+
132
140
return $ data ;
133
141
}
134
142
You can’t perform that action at this time.
0 commit comments