You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
468 B

<?php
class AsciiSortedIterator extends SplHeap
{
public function __construct(Iterator $iterator)
{
foreach ($iterator as $item) {
$this->insert($item);
}
}
public function compare($b,$a)
{
/**
* @var $a SplFileInfo
* @var $b SplFileInfo
*/
return strcmp($a->getPath() . DIRECTORY_SEPARATOR . $a->getFileName(), $b->getPath() . DIRECTORY_SEPARATOR . $b->getFileName());
}
}