Sorry if I misunderstood your question, but scandir
should work with custom stream. Example:
$structure = array(
'tmp' => array(
'music' => array(
'wawfiles' => array(
'mp3' => array(),
'hello world.waw' => 'nice song',
'abc.waw' => 'bad song',
'put that cookie down.waw' => 'best song ever',
"zed's dead baby.waw" => 'another cool song'
)
)
)
);
$vfs = vfsStream::setup('root');
vfsStream::create($structure, $vfs);
$music = vfsStream::url('root/tmp/music/wawfiles');
var_dump(scandir($music));
Output:
array(5) {
[0]=>
string(7) "abc.waw"
[1]=>
string(15) "hello world.waw"
[2]=>
string(3) "mp3"
[3]=>
string(24) "put that cookie down.waw"
[4]=>
string(19) "zed's dead baby.waw"
}