#
# This file is part of Koha.
#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
-use strict;
-use warnings;
+use Modern::Perl;
+use Carp;
use Getopt::Long;
use C4::Context;
my $root_dir = C4::Context->config('intranetdir') . '/installer/data/mysql';
my $base_syspref_file = "sysprefs.sql";
-open( my $ref_fh, "<$root_dir/$base_syspref_file" );
+open my $ref_fh, '<', "$root_dir/$base_syspref_file" or croak "Can't open '$root_dir/$base_syspref_file': $!";
my $ref_syspref = get_syspref_from_file($ref_fh);
my @ref_sysprefs = sort { lc $a cmp lc $b } keys %$ref_syspref;
+my $num_sysprefs = scalar @ref_sysprefs;
if ( !$showsql ) {
- cmp_ok( $#ref_sysprefs, '>=', 0,
- "Found " . ( $#ref_sysprefs + 1 ) . " sysprefs" );
+ cmp_ok( $num_sysprefs, '>', 0,
+ "Found $num_sysprefs sysprefs" );
}
check_db($ref_syspref);
#
# Get sysprefs from SQL file populating sysprefs table with INSERT statement.
#
-# Exemple:
+# Example:
# INSERT INTO `systempreferences` (variable,value,explanation,options,type)
# VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web Services',
# 'US|CA|DE|FR|JP|UK','Choice')