summaryrefslogtreecommitdiffstats
path: root/admin/docblocks.pl
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2006-01-05 20:48:32 +0000
committertailor <cygnus@janrain.com>2006-01-05 20:48:32 +0000
commita727a9c35ee6970b5b5118da5e15695005c988bb (patch)
tree97fd8b76133304036706b20e46deec6c5ec11e66 /admin/docblocks.pl
parentb5d63edfa89d3bc2428ebf1d616970e867d602b8 (diff)
downloadphp-openid-a727a9c35ee6970b5b5118da5e15695005c988bb.zip
php-openid-a727a9c35ee6970b5b5118da5e15695005c988bb.tar.gz
php-openid-a727a9c35ee6970b5b5118da5e15695005c988bb.tar.bz2
[project @ Added script to check for docblocks in PHP scripts]
Diffstat (limited to 'admin/docblocks.pl')
-rw-r--r--admin/docblocks.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/admin/docblocks.pl b/admin/docblocks.pl
new file mode 100644
index 0000000..0483dbb
--- /dev/null
+++ b/admin/docblocks.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/env perl -w
+
+use strict;
+
+my $filename = $ARGV[0];
+
+if (!$filename) {
+ print "Usage: docblocks.pl <filename>\n";
+ exit(1);
+}
+
+my %allowed = ("" => 1,
+ "<?php" => 1);
+
+open(HANDLE, "<", $filename) or die "Cannot open $filename\n";
+
+while (<HANDLE>) {
+ chomp;
+
+ if ($_ =~ /\/\*\*/) {
+ exit(0);
+ } elsif (!$allowed{$_}) {
+ print $filename."\n";
+ exit(1);
+ }
+}