## Rough check that the base and postgres "tables.sql" are in sync
## Should be run from maintenance/postgres
+## Checks a few other things as well...
use strict;
use warnings;
use Data::Dumper;
+check_includes_dir();
+
my @old = ('../tables.sql');
my $new = 'tables.sql';
my @xfile;
} ## end each file to be parsed
+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
+
__DATA__
## Known exceptions
OLD: searchindex ## We use tsearch2 directly on the page table instead