removing WSClient

This commit is contained in:
Graham Knop 2008-12-03 00:32:58 +00:00
parent 585e608506
commit 0957247dbc
6 changed files with 34 additions and 567 deletions

View file

@ -31,13 +31,36 @@ my $session = start(); # this line required
fixAccountMisspellings( $session );
removeTemplateHeadBlock( $session );
updateMatrixListingScores( $session );
removeSqlForm( $session );
# upgrade functions go here
finish($session); # this line required
#----------------------------------------------------------------------------
sub removeSqlForm {
my $session = shift;
print "\tOptionally removing Web Services Client...\n" unless $quiet;
my $db = $session->db;
unless ($db->quickScalar("select count(*) from asset where className='WebGUI::Asset::Wobject::WSClient'")) {
print "\t\tNot using it, so we're uninstalling it.\n" unless $quiet;
$session->config->delete("assets/WebGUI::Asset::Wobject::WSClient");
my @ids = $db->buildArray("select distinct assetId from template where namespace = 'WSClient'");
push @ids, qw(5YAbuwiVFUx-z8hcOAnsdQ);
foreach my $id (@ids) {
my $asset = WebGUI::Asset->newByDynamicClass($session, $id);
if (defined $asset) {
$asset->purge;
}
}
$db->write("drop table WSClient");
}
else {
print "\t\tThis site uses Web Services Client, so we won't uninstall it.\n" unless $quiet;
}
}
#----------------------------------------------------------------------------
# Describe what our function does
sub updateMatrixListingScores {
my $session = shift;