From 607a251b11cf131e059067c0ae4bc039468057c8 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Mon, 7 Nov 2005 02:01:15 +0000 Subject: [PATCH] adding skeletons --- docs/changelog/6.x.x.txt | 1 + docs/upgrades/_upgrade.skeleton | 55 ++++++++++++++++++++++++++++++++ lib/WebGUI/Macro/_macro.skeleton | 26 +++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 docs/upgrades/_upgrade.skeleton create mode 100644 lib/WebGUI/Macro/_macro.skeleton diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index c2667175c..861a35206 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -10,6 +10,7 @@ - Changed macro API which cuts macro memory consumption in half. See migration.txt for details. - Added automated code testing framework. + - Added code skeletons for the various plugins WebGUI supports. 6.7.7 diff --git a/docs/upgrades/_upgrade.skeleton b/docs/upgrades/_upgrade.skeleton new file mode 100644 index 000000000..266d41d64 --- /dev/null +++ b/docs/upgrades/_upgrade.skeleton @@ -0,0 +1,55 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2005 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use lib "../../lib"; +use strict; +use Getopt::Long; +use WebGUI::Session; + + +my $toVersion = "0.0.0"; # make this match what version you're going to +my $quiet; # this line required + + +start(); # this line required + +# upgrade functions go here + +finish(); # this line required + + +##------------------------------------------------- +#sub exampleFunction { +# print "\tWe're doing some stuff here that you should know about.\n" unless ($quiet); +# # and here's our code +#} + + + +# ---- DO NOT EDIT BELOW THIS LINE ---- + +#------------------------------------------------- +sub start { + my $configFile; + $|=1; #disable output buffering + GetOptions( + 'configFile=s'=>\$configFile, + 'quiet'=>\$quiet + ); + WebGUI::Session::open("../..",$configFile); + WebGUI::Session::refreshUserInfo(3); + WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")"); +} + +#------------------------------------------------- +sub finish { + WebGUI::Session::close(); +} + diff --git a/lib/WebGUI/Macro/_macro.skeleton b/lib/WebGUI/Macro/_macro.skeleton new file mode 100644 index 000000000..f6fa87cb0 --- /dev/null +++ b/lib/WebGUI/Macro/_macro.skeleton @@ -0,0 +1,26 @@ +package WebGUI::Macro::MacroSkeleton; # edit this line to match your own macro name + +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2005 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use strict; +use WebGUI::Session; + +#------------------------------------------------------------------- +sub process { + my $somePassedInParameter = shift; + my $someOtherPassedInParameter = shift; + my $output = ""; # do some stuff + return $output; +} + +1; + +