20) { die('[]'); } } sleep(1); die('[]'); } if (strpos($branch, '..') !== false) { // path should not have a [..] inside ;-) $branch = 'undefined'; } // a small delay so we can see the loading animation // (comment it for faster return) sleep(1); // no cache so we can see the loading animation :) header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); // get the branch (1 level) $fsTree->json($branch); // this will get the entire tree (comment above and uncomment this) //$fsTree->json($branch, true);