Use scandir instead of opendir to ensure alphabetical order.

pico-3.0-alpha
Danyel Bayraktar 10 years ago
parent e942d40187
commit 8d82cde120
  1. 5
      lib/pico.php

@ -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;

Loading…
Cancel
Save