summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-09-10 11:26:53 (GMT)
committerAntony Dovgal <tony2001@php.net>2006-09-10 11:26:53 (GMT)
commit42d4e3533e011234650b2e15f8fe7ca5738df94d (patch)
treee76923b8aa35cef3ed14789b322069a767ff32da /scripts
parent935b0c88e9772f165db25cb04b7497645b66c414 (diff)
downloadphp-42d4e3533e011234650b2e15f8fe7ca5738df94d.tar.gz
MFH: improve the script
Diffstat (limited to 'scripts')
-rw-r--r--scripts/dev/check_parameters.php34
1 files changed, 33 insertions, 1 deletions
diff --git a/scripts/dev/check_parameters.php b/scripts/dev/check_parameters.php
index d08a8b1..f79f868 100644
--- a/scripts/dev/check_parameters.php
+++ b/scripts/dev/check_parameters.php
@@ -333,4 +333,36 @@ function recurse($path)
}
}
-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);
+}