Use scandir instead of opendir to ensure alphabetical order.

This commit is contained in:
Danyel Bayraktar 2015-07-14 13:31:51 +02:00
parent e942d40187
commit 8d82cde120

View file

@ -359,8 +359,8 @@ class Pico
protected function get_files($directory, $ext = '')
{
$array_items = array();
if ($handle = opendir($directory)) {
while (false !== ($file = readdir($handle))) {
if ($files = scandir($directory)) {
foreach ($files as $file) {
if (in_array(substr($file, -1), array('~', '#'))) {
continue;
}
@ -375,7 +375,6 @@ class Pico
}
}
}
closedir($handle);
}
return $array_items;