diff --git a/sbin/testEnvironment.pl b/sbin/testEnvironment.pl index ad12ec96d..205105a63 100644 --- a/sbin/testEnvironment.pl +++ b/sbin/testEnvironment.pl @@ -102,7 +102,6 @@ checkModule("HTML::Highlight",0.20); checkModule("HTML::TagFilter",0.07); checkModule("HTML::Template",2.9); checkModule("HTML::Template::Expr",0.05,2); -checkModule("Parse::PlainConfig",1.1); checkModule("XML::RSSLite",0.11); checkModule("JSON",0.991); checkModule("Config::JSON","1.0.3"); diff --git a/sbin/upgrade.pl b/sbin/upgrade.pl index c3525836a..0c322fb73 100644 --- a/sbin/upgrade.pl +++ b/sbin/upgrade.pl @@ -20,7 +20,6 @@ use DBI; use File::Path; use Getopt::Long; use JSON; -use Parse::PlainConfig; use WebGUI::Config; use WebGUI::Session; use WebGUI::Utility; @@ -160,23 +159,6 @@ our (%upgrade, %config); ## Find site configs. -print "\nTesting site config versions...\n" unless ($quiet); -opendir(DIR,"../etc"); -my @files = readdir(DIR); -closedir(DIR); -foreach my $file (@files) { - next unless ($file =~ m/\.conf$/); - next if ($file eq "spectre.conf" || $file eq "log.conf"); - my $configFile = "../etc/".$file; - open(FILE,"<".$configFile); - my $line = ; - close(FILE); - unless ($line =~ m/JSON 1/) { - print "\tConverting ".$file." from PlainConfig to JSON\n" unless ($quiet); - convertPlainconfigToJson($configFile); - } -} - print "\nGetting site configs...\n" unless ($quiet); my $configs = WebGUI::Config->readAllConfigs($webguiRoot); foreach my $filename (keys %{$configs}) { @@ -427,25 +409,3 @@ sub _parseDSN { } -#----------------------------------------- -sub convertPlainconfigToJson { - my $configFile = shift; - my $pp = Parse::PlainConfig->new('DELIM' => '=', 'FILE' => $configFile, 'PURGE' => 1); - my %config = (); - foreach my $param ($pp->directives) { - my $value = $pp->get($param); - if (isIn($param, qw(sitename templateParsers assets utilityAssets assetContainers authMethods shippingPlugins paymentPlugins))) { - if (ref $value ne "ARRAY") { - $value = [$value]; - } - } elsif (isIn($param, qw(assetAddPrivilege macros))) { - if (ref $value ne "HASH") { - $value = {}; - } - } - $config{$param} = $value; - } - open(FILE,">".$configFile); - print FILE "# config-file-type: JSON 1\n".objToJson(\%config, {pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1}); - close(FILE); -}