tony2001 Sun Sep 10 11:26:07 2006 UTC Modified files: /php-src/scripts/dev check_parameters.php Log: add help scan directories specified in argv http://cvs.php.net/viewvc.cgi/php-src/scripts/dev/check_parameters.php?r1=1.2&r2=1.3&diff_format=u Index: php-src/scripts/dev/check_parameters.php diff -u php-src/scripts/dev/check_parameters.php:1.2 php-src/scripts/dev/check_parameters.php:1.3 --- php-src/scripts/dev/check_parameters.php:1.2 Fri Sep 8 16:37:19 2006 +++ php-src/scripts/dev/check_parameters.php Sun Sep 10 11:26:07 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: check_parameters.php,v 1.2 2006/09/08 16:37:19 nlopess Exp $ */ +/* $Id: check_parameters.php,v 1.3 2006/09/10 11:26:07 tony2001 Exp $ */ define('REPORT_LEVEL', 2); // 0 reports less false-positives. up to level 5. @@ -333,4 +333,36 @@ } } -recurse(PHPDIR); +$dirs = array(); + +if (isset($argc) && $argc > 1) { + if ($argv[1] == '-h' || $argv[1] == '-help' || $argv[1] == '--help') { + echo <<<HELP +Synopsis: + php check_parameters.php [directories] + +HELP; + exit(0); + } + for ($i = 1; $i < $argc; $i++) { + $dirs[] = $argv[$i]; + } +} else { + $dirs[] = PHPDIR; +} + +foreach($dirs as $dir) { + if (is_dir($dir)) { + if (!is_readable($dir)) { + echo "ERROR: directory '", $dir ,"' is not readable\n"; + exit(1); + } + } else { + echo "ERROR: bogus directory '", $dir ,"'\n"; + exit(1); + } +} + +foreach ($dirs as $dir) { + recurse($dir); +}
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php