ls.php 457 B

1234567891011121314151617181920
  1. <?php
  2. header("Content-Type: application/json");
  3. $directories = array();
  4. if ($handle = opendir(getcwd())) {
  5. while (false !== ($file = readdir($handle))) {
  6. if (is_dir($file) && $file[0] !== "." ) {
  7. array_push($directories, $file);
  8. }
  9. }
  10. closedir($handle);
  11. }
  12. $test_pages = array_merge($directories, glob("**/*-tests.html"));
  13. sort($test_pages);
  14. echo '{ "testPages":["' . implode( '","', $test_pages ) . '"]}';
  15. ?>