|
|
|
@ -29,7 +29,7 @@ $terms = null; |
|
|
|
|
// now get all terms found in all PHP files of Chamilo (this takes some time and memory) |
|
|
|
|
$undefined_terms = []; |
|
|
|
|
$l = strlen(api_get_path(SYS_PATH)); |
|
|
|
|
$files = get_all_php_files(api_get_path(SYS_PATH)); |
|
|
|
|
$files = getAllPhpFiles(api_get_path(SYS_PATH)); |
|
|
|
|
foreach ($files as $file) { |
|
|
|
|
//echo 'Analyzing '.$file."<br />"; |
|
|
|
|
$shortfile = substr($file, $l); |
|
|
|
@ -73,29 +73,3 @@ foreach ($undefined_terms as $term => $file) { |
|
|
|
|
} |
|
|
|
|
echo "</table>\n"; |
|
|
|
|
|
|
|
|
|
function get_all_php_files($base_path) |
|
|
|
|
{ |
|
|
|
|
$list = scandir($base_path); |
|
|
|
|
$files = []; |
|
|
|
|
foreach ($list as $item) { |
|
|
|
|
if (substr($item, 0, 1) == '.') { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
$special_dirs = [api_get_path(SYS_TEST_PATH), api_get_path(SYS_COURSE_PATH), api_get_path(SYS_LANG_PATH), api_get_path(SYS_ARCHIVE_PATH)]; |
|
|
|
|
if (in_array($base_path.$item.'/', $special_dirs)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (is_dir($base_path.$item)) { |
|
|
|
|
$files = array_merge($files, get_all_php_files($base_path.$item.'/')); |
|
|
|
|
} else { |
|
|
|
|
//only analyse php files |
|
|
|
|
$sub = substr($item, -4); |
|
|
|
|
if ($sub == '.php' or $sub == '.tpl') { |
|
|
|
|
$files[] = $base_path.$item; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$list = null; |
|
|
|
|
|
|
|
|
|
return $files; |
|
|
|
|
} |
|
|
|
|