some changes

This commit is contained in:
Matthew Wilson 2006-01-15 23:22:52 +00:00
parent 453942cb58
commit 00d97170f9

View file

@ -21,7 +21,6 @@ use Getopt::Long;
use strict; use strict;
use WebGUI::Config; use WebGUI::Config;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Setting;
use WebGUI::SQL; use WebGUI::SQL;
my $help; my $help;
@ -144,7 +143,7 @@ our (%upgrade, %config);
## Find site configs. ## Find site configs.
print "\nGetting site configs...\n" unless ($quiet); print "\nGetting site configs...\n" unless ($quiet);
my $configs = WebGUI::Config::readAllConfigs($webguiRoot); my $configs = WebGUI::Config->readAllConfigs($webguiRoot);
foreach my $filename (keys %{$configs}) { foreach my $filename (keys %{$configs}) {
print "\tProcessing $filename.\n" unless ($quiet); print "\tProcessing $filename.\n" unless ($quiet);
$config{$filename}{configFile} = $filename; $config{$filename}{configFile} = $filename;
@ -164,10 +163,10 @@ foreach my $filename (keys %{$configs}) {
order by dateApplied desc, webguiVersion desc limit 1",$dbh); order by dateApplied desc, webguiVersion desc limit 1",$dbh);
unless ($history) { unless ($history) {
print "\tPreparing site for upgrade.\n" unless ($quiet); print "\tPreparing site for upgrade.\n" unless ($quiet);
WebGUI::Session::open($webguiRoot,$filename); my $session = WebGUI::Session::open($webguiRoot,$filename);
WebGUI::Setting::remove('specialState'); $session->setting->remove('specialState');
WebGUI::Setting::add('specialState','upgrading'); $session->add('specialState','upgrading');
WebGUI::Session::close(); $session->close();
print "\tDeleting temp files.\n" unless ($quiet); print "\tDeleting temp files.\n" unless ($quiet);
my $path = $configs->{$filename}{uploadsPath}.$slash."temp"; my $path = $configs->{$filename}{uploadsPath}.$slash."temp";
rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data");