tony2001                Sun Sep 10 11:26:53 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/scripts/dev        check_parameters.php 
  Log:
  MFH: improve the script
  
  
http://cvs.php.net/viewvc.cgi/php-src/scripts/dev/check_parameters.php?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/scripts/dev/check_parameters.php
diff -u php-src/scripts/dev/check_parameters.php:1.1.2.1 
php-src/scripts/dev/check_parameters.php:1.1.2.2
--- php-src/scripts/dev/check_parameters.php:1.1.2.1    Fri Sep  8 16:35:17 2006
+++ php-src/scripts/dev/check_parameters.php    Sun Sep 10 11:26:53 2006
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: check_parameters.php,v 1.1.2.1 2006/09/08 16:35:17 nlopess Exp $ */
+/* $Id: check_parameters.php,v 1.1.2.2 2006/09/10 11:26:53 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

Reply via email to