mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
sorted directories to create consistent/readable order of execution
This commit is contained in:
parent
5a14398c55
commit
2fda8f7efc
1 changed files with 4 additions and 3 deletions
|
|
@ -1,17 +1,18 @@
|
|||
<?php
|
||||
header("Content-Type: application/json");
|
||||
|
||||
$response = array( 'directories' => array());
|
||||
$directories = array();
|
||||
|
||||
if ($handle = opendir(getcwd())) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if (is_dir($file) && $file[0] !== "." ) {
|
||||
array_push($response['directories'], $file);
|
||||
array_push($directories, $file);
|
||||
}
|
||||
}
|
||||
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
echo json_encode($response)
|
||||
sort($directories);
|
||||
echo json_encode( array('directories' => $directories ));
|
||||
?>
|
||||
Loading…
Reference in a new issue