Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 41 lines (35 sloc) 0.933 kb
#!/usr/bin/env perl
# script to test for missing systempreferences
# export KOHA_CONF
# export PERL5LIB
# then ./ path (if path is blank it will use .)
use File::Find;
use Koha;
use C4::Context;
@ARGV = qw(.) unless @ARGV;
sub check_sys_pref {
my $dbh = C4::Context->dbh();
my $query = "SELECT * FROM systempreferences WHERE variable = ?";
my $sth = $dbh->prepare($query);
if (! -d _ ){
my $name=$File::Find::name;
if ($name =~ /(\.pl|\.pm)$/){
open (FILE,"$_") || die "cant open $name";
while (my $inp = <FILE>){
if ($inp =~ /C4::Context->preference\((.*?)\)/){
my $variable = $1;
$variable =~s /\'|\"//g;
if (my $data=$sth->fetchrow_hashref()){
else {
print "$name has a reference to $variable, this does not exist in the database\n";
close FILE;
Jump to Line
Something went wrong with that request. Please try again.