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