public function dir($path) { $upload_dir = $this->_config['upload_dir']; $config = [ 'basedir' => $upload_dir, 'use_locks' => true ];
$area = \File::forge($config);
$files = $area->read_dir($path, 1, null);
...
}
Then I expected to get $files as array and use
foreach ($files as $dir => $file) { ... }
but iteration does not perform. Furthermore $files is instance of File_Handler_Directory class... another $files->read() returns again instance of File_Handler_Directory... So, how can I get array finally?
I can see that the array is created, and is passed to File_Handler_Directory, where it is stored in the "content" property. But there is no code in that class that does anything with that property?
From what it looks like, someone has started work encapsulating results in an object instead of returning an array. The File_Handler_File class doesn't even store the content passed, so that is useless to.
Interesting that after 8 years someone bumps into this... ;-)
I think the Area class should be changed to:
public function read_dir($path, $depth = 0, $filter = null)