+sub check_includes_dir {
+
+ ## Check for some common errors in the files in the includes directory
+
+ print "Checking files in includes directory...\n";
+ my $dir = "../../includes";
+ opendir my $dh, $dir or die qq{Could not opendir $dir: $!\n};
+ for my $file (grep { -f "$dir/$_" and /\.php$/ } readdir $dh) {
+ $file = "$dir/$file";
+ open my $fh, '<', $file or die qq{Could not open "$file": $!\n};
+ while (<$fh>) {
+ if (/FORCE INDEX/ and $file !~ /Database.php/) {
+ warn "Found FORCE INDEX string at line $. of $file\n";
+ }
+ if (/REPLACE INTO/ and $file !~ /Database/) {
+ warn "Found REPLACE INTO string at line $. of $file\n";
+ }
+ if (/\bIF\s*\(/ and $file !~ /Database.php/) {
+ warn "Found IF string at line $. of $file\n";
+ }
+ if (/\bCONCAT\b/ and $file !~ /Database.php/) {
+ warn "Found CONCAT string at line $. of $file\n";
+ }
+ }
+ close $fh or die qq{Could not close "$file": $!\n};
+ }
+ closedir $dh or die qq{Closedir failed?!\n};
+
+
+
+
+} ## end of check_includes_dir
+