File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed
Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -333,4 +333,36 @@ function recurse($path)
333333 }
334334}
335335
336- recurse (PHPDIR );
336+ $ dirs = array ();
337+
338+ if (isset ($ argc ) && $ argc > 1 ) {
339+ if ($ argv [1 ] == '-h ' || $ argv [1 ] == '-help ' || $ argv [1 ] == '--help ' ) {
340+ echo <<<HELP
341+ Synopsis:
342+ php check_parameters.php [directories]
343+
344+ HELP ;
345+ exit (0 );
346+ }
347+ for ($ i = 1 ; $ i < $ argc ; $ i ++) {
348+ $ dirs [] = $ argv [$ i ];
349+ }
350+ } else {
351+ $ dirs [] = PHPDIR ;
352+ }
353+
354+ foreach ($ dirs as $ dir ) {
355+ if (is_dir ($ dir )) {
356+ if (!is_readable ($ dir )) {
357+ echo "ERROR: directory ' " , $ dir ,"' is not readable \n" ;
358+ exit (1 );
359+ }
360+ } else {
361+ echo "ERROR: bogus directory ' " , $ dir ,"' \n" ;
362+ exit (1 );
363+ }
364+ }
365+
366+ foreach ($ dirs as $ dir ) {
367+ recurse ($ dir );
368+ }
You can’t perform that action at this time.
0 commit comments