3 # script to test for missing systempreferences
6 # then ./check_sysprefs.pl path (if path is blank it will use .)
9 #use warnings; FIXME - Bug 2505
14 @ARGV = qw(.) unless @ARGV;
17 my $dbh = C4::Context->dbh();
18 my $query = "SELECT * FROM systempreferences WHERE variable = ?";
19 my $sth = $dbh->prepare($query);
21 my $name=$File::Find::name;
22 if ($name =~ /(\.pl|\.pm)$/){
23 open (FILE,"$_") || die "cant open $name";
24 while (my $inp = <FILE>){
25 if ($inp =~ /C4::Context->preference\((.*?)\)/){
27 $variable =~s /\'|\"//g;
28 $sth->execute($variable);
29 if (my $data=$sth->fetchrow_hashref()){
32 print "$name has a reference to $variable, this does not exist in the database\n";
42 find(\&check_sys_pref,@ARGV);