fixed upgrade skeleton to work with new session api
set up _upgrade.skeleton
This commit is contained in:
parent
aec8e8e0cf
commit
20d259dd0d
25 changed files with 71 additions and 13180 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2005 Plain Black Corporation.
|
||||
# WebGUI is Copyright 2001-2006 Plain Black Corporation.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
|
|
@ -12,22 +12,22 @@ use lib "../../lib";
|
|||
use strict;
|
||||
use Getopt::Long;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
|
||||
my $toVersion = "0.0.0"; # make this match what version you're going to
|
||||
my $quiet; # this line required
|
||||
|
||||
|
||||
start(); # this line required
|
||||
my $session = start(); # this line required
|
||||
|
||||
# upgrade functions go here
|
||||
|
||||
finish(); # this line required
|
||||
finish($session); # this line required
|
||||
|
||||
|
||||
##-------------------------------------------------
|
||||
#sub exampleFunction {
|
||||
# my $session = shift;
|
||||
# print "\tWe're doing some stuff here that you should know about.\n" unless ($quiet);
|
||||
# # and here's our code
|
||||
#}
|
||||
|
|
@ -44,13 +44,15 @@ sub start {
|
|||
'configFile=s'=>\$configFile,
|
||||
'quiet'=>\$quiet
|
||||
);
|
||||
WebGUI::Session::open("../..",$configFile);
|
||||
WebGUI::Session::refreshUserInfo(3);
|
||||
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
|
||||
my $session = WebGUI::Session->open("../..",$configFile);
|
||||
$session->user({userId=>3});
|
||||
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".$session->datetime->time().")");
|
||||
return $session;
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
sub finish {
|
||||
WebGUI::Session::close();
|
||||
my $session = shift;
|
||||
$session->close();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue