992cd4efb6
This was inserted as a class inbetween RecursiveArrayIterator and DirectoryIterator. Sadly our RecursiveArrayIterator implementaiton is crazy and calls into C++ which can't call back up to `parent::method()`. I'll fix RecursiveArrayIterator in another diff.
23 linhas
498 B
PHP
23 linhas
498 B
PHP
<?php
|
|
$sample_dir = __DIR__.'/../../sample_dir';
|
|
$iterator = new FilesystemIterator(
|
|
$sample_dir,
|
|
FilesystemIterator::KEY_AS_PATHNAME
|
|
);
|
|
echo "Key as Pathname:\n";
|
|
$ret = array();
|
|
foreach ($iterator as $key => $fileinfo) {
|
|
$ret[] = $key;
|
|
}
|
|
asort($ret);
|
|
var_dump(array_values($ret));
|
|
|
|
$iterator->setFlags(FilesystemIterator::KEY_AS_FILENAME);
|
|
echo "\nKey as Filename:\n";
|
|
$ret = array();
|
|
foreach ($iterator as $key => $fileinfo) {
|
|
$ret[] = $key;
|
|
}
|
|
asort($ret);
|
|
var_dump(array_values($ret));
|