/** * Scans current folder and subfolders for .php files */ static function AJAX_Scan() { $list = RecursiveScanDir(__DIR__); usort($list, "strnatcasecmp"); // No files? if (!$list || !count($list)) { die("No .php files located in this<br />folder and/or subfolders"); } // For each file we'll present something nice $out = ""; foreach ($list as $file) { // If Mode is set to 1, we need to parse the file and check the completion $analysis = ""; if ($_POST['Mode']) { $analysis = DocBlock::AnalyzeFile($file); } $out .= "\n\t\t\t\t{$analysis}<a href='#' data-filename='" . rawurlencode($file) . "' class='filelink'>{$file}</a><br />\n\t\t\t"; } // Ouptut echo $out; // Exit "Gracefully" exit(0); }