X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Ffunctions_test.inc;h=5d29176f54885e564dc4cae303ed345e479aa966;hb=f50ef17975b60fd8c6394f8c6e7f1250bd95b1eb;hp=01e513475691672b31383cddd49621c992e7f352;hpb=b0580435a641f9a3c29c67120139df755c66a39a;p=gosa.git diff --git a/include/functions_test.inc b/include/functions_test.inc index 01e513475..5d29176f5 100644 --- a/include/functions_test.inc +++ b/include/functions_test.inc @@ -49,7 +49,7 @@ function cmd_test_functions($path) { } /** - * Scans files in $path an checks for calls of functions. + * Scans files in $path and checks for calls of functions. * @param $path Path to search for files in (default: "./") * @param $pattern RegEx-Pattern for matching PHP-Files (default: "/.+\.(php[34]?$)|(inc$)/") * @param $skip_dirs RegEx-Pattern for directories to ignore (default: ".svn") @@ -75,7 +75,9 @@ function test_defined_functions($path="",$pattern="",$skip_dirs="") { // Needed arrays $functions= array(); - $user_functions= array(); + + // We need to include our own function here, because PHP seems to lock the current executed function + $user_functions= array('test_defined_functions'); // Scan files for used defined functions foreach($array as $file) { @@ -108,7 +110,7 @@ function test_defined_functions($path="",$pattern="",$skip_dirs="") { } /** - * Scans files in $path an checks for calls of functions that are undefined. + * Scans files in $path and checks for calls of functions that are undefined. * Edit $debug and $verbose to control output. Default is 'false' for both to disallow * console functionality. * @param $path Path to search for files in (default: "./") @@ -260,7 +262,8 @@ function filter_meta_functions ($function) { } /** - * @return true if $function is a known php-function, false otherwise + * Returns true if $function is a known php-function, false otherwise. + * @return true if $function is a known php-function, false otherwise. */ function check_function($function) { $result= false; @@ -274,7 +277,9 @@ function check_function($function) { return $result; } -/** @return true if $function is meta-function, false otherwise */ +/** Returns true if $function is meta-function, false otherwise. + * @return true if $function is meta-function, false otherwise. + */ function is_meta_function($function) { $meta_functions= array( "print","array","isset","exit","unset", @@ -283,7 +288,9 @@ function is_meta_function($function) { return(in_array($function,$meta_functions)); } -/** @return true if $function is keyword, false otherwise */ +/** Returns true if $function is keyword, false otherwise. + * @return true if $function is keyword, false otherwise. + */ function is_keyword($function) { $keywords= array( "if","else","elseif","while","do","case", @@ -297,8 +304,9 @@ function is_keyword($function) { } /** + * Returns array of called functions. * @param $string PHP-Code - * @return array of called functions + * @return array of called functions. */ function extract_php_functions($string) { // Function names have to be A-z or _ for the first letter @@ -362,7 +370,8 @@ function extract_user_functions($string) { } /** - * @return php-code without