diff --git a/docs/gotcha.txt b/docs/gotcha.txt index c0e244092..202af88ad 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -35,6 +35,9 @@ save you many hours of grief. background-color: #dddddd; } + See the WebGUI help system about "Styles, Using" for more + information and examples. + * If you have downloaded and installed the HttpProxy wobject from the contributions then you will need to delete it prior to upgrading or the database upgrade will fail. To remove it @@ -57,19 +60,33 @@ save you many hours of grief. * The discussions on USS and Articles have been turned off. They'll need to be manually turned back on. - * The setting "cachePages" has been removed from the config file. It - has been moved to the content settings page inside the UI. + * The wobject API has changed significantly. It is backward + compatible for the time being, but if you're building custom + wobjects, you should migrate them to the new API. Doing so + will likely reduce a lot of the code in your wobject as an + added benefit. - * The setting "cacheInternational" has been removed from the config - file. The international messages are now automatically cached - if caching is available. + * If you do not use the automatic upgrade utility, you'll also need + to take note of the following gotchas: - * After upgrading please remove the SyndicatedContent.pm file from - sbin/Hourly as it is no longer required, and will cause - problems if it is not removed. + * The setting "cachePages" has been removed from the config + file. It has been moved to the content settings page + inside the UI. - * imageCollateralImport.pl has been replaced by collateralImport.pl. - Please delete imageCollateralImport.pl. + * The setting "cacheInternational" has been removed from the + config file. The international messages are now + automatically cached if caching is available. + + * After upgrading please remove the SyndicatedContent.pm + file from sbin/Hourly as it is no longer required, + and will cause problems if it is not removed. + + * imageCollateralImport.pl has been replaced by + collateralImport.pl. Please delete + imageCollateralImport.pl. + + * The config file syntax has changed. Update your config + file to match etc/WebGUI.conf.original. 5.1.0 diff --git a/docs/upgrades/upgrade_5.1.2-5.2.0.pl b/docs/upgrades/upgrade_5.1.2-5.2.0.pl new file mode 100644 index 000000000..e83fb6383 --- /dev/null +++ b/docs/upgrades/upgrade_5.1.2-5.2.0.pl @@ -0,0 +1,127 @@ +#!/usr/bin/perl + +use lib "../../lib"; +use Data::Config; +use Getopt::Long; +use Parse::PlainConfig; +use strict; +use WebGUI::Utility; + + +my $configFile; +my $quiet; + +GetOptions( + 'configFile=s'=>\$configFile, + 'quiet'=>\$quiet +); + +print "\tUpdating config file.\n" unless ($quiet); + +my $pathToConfig = '../../etc/'.$configFile; +my $dataconfig = new Data::Config $pathToConfig; +my $plainconfig = Parse::PlainConfig->new('DELIM' => '=', 'PURGE' => 1); + +my ($excludeWobject, $excludeMacro, $excludeAuthentication); +foreach my $key ($dataconfig->param) { + if ($key eq "excludeWobject") { + $excludeWobject = $dataconfig->param($key); + } elsif ($key eq "excludeMacro") { + $excludeMacro = $dataconfig->param($key); + } elsif ($key eq "excludeAuthentication") { + $excludeAuthentication = $dataconfig->param($key); + } elsif ($key eq "cachePages" || $key eq "cacheInternational") { + #do nothing + } else { + $plainconfig->set($key=>$dataconfig->param($key)); + } +} + + +opendir (DIR,"../../lib/WebGUI/Wobject") or die "Can't find Wobjects."; +my @wobjectList = readdir(DIR); +closedir(DIR); + +$excludeWobject =~ s/ //g; +my @excludeList = split(/,/,$excludeWobject); + +my @wobjects; + +foreach my $wobject (@wobjectList) { + if ($wobject =~ /(.*?)\.pm$/) { + $wobject = $1; + unless (isIn($wobject, @excludeList)) { + push(@wobjects,$wobject); + } + } +} + +$plainconfig->set("wobjects"=>\@wobjects); + + + +opendir (DIR,"../../lib/WebGUI/Macro") or die "Can't find Macros."; +my @macroList = readdir(DIR); +closedir(DIR); + +$excludeMacro =~ s/ //g; +@excludeList = split(/,/,$excludeMacro); + +my %macros; + +foreach my $macro (@macroList) { + if ($macro =~ /(.*?)\.pm$/) { + $macro = $1; + unless (isIn($macro, @excludeList)) { + my @alias = split(/_/,$macro); + if ($alias[0] eq "Splat") { + $alias[0] = "*"; + } elsif ($alias[0] eq "Slash") { + $alias[0] = "/"; + } elsif ($alias[0] eq "Backslash") { + $alias[0] = '\\\\'; + } elsif ($alias[0] eq "Question") { + $alias[0] = "?"; + } elsif ($alias[0] eq "At") { + $alias[0] = "\@"; + } elsif ($alias[0] eq "Hash") { + $alias[0] = "#"; + } + $macros{$alias[0]} = $macro; + } + } +} + +$plainconfig->set("macros"=>\%macros); + + + +opendir (DIR,"../../lib/WebGUI/Authentication") or die "Can't find Auth Methods."; +my @authMethodList = readdir(DIR); +closedir(DIR); + +$excludeAuthentication =~ s/ //g; +@excludeList = split(/,/,$excludeAuthentication); +push (@excludeList,"SMB"); + +my @authMethods; + +foreach my $authMethod (@authMethodList) { + if ($authMethod =~ /(.*?)\.pm$/) { + $authMethod = $1; + unless (isIn($authMethod, @excludeList)) { + push(@authMethods,$authMethod); + } + } +} + +$plainconfig->set("authMethods"=>\@authMethods); + +$plainconfig->write($pathToConfig,3); + + +print "\tRemoving unneeded files.\n" unless ($quiet); + +unlink("../../sbin/Hourly/SyndicatedContent.pm"); +unlink("../../sbin/imageCollateralImport.pl"); + diff --git a/sbin/upgrade.pl b/sbin/upgrade.pl index 005591092..85a1fbe08 100644 --- a/sbin/upgrade.pl +++ b/sbin/upgrade.pl @@ -139,12 +139,13 @@ closedir(DIR); foreach $file (@files) { if ($file =~ /upgrade_(\d+\.\d+\.\d+)-(\d+\.\d+\.\d+)\.(\w+)/) { if (checkVersion($1)) { + $upgrade{$1}{dir} = $dir; if ($3 eq "sql") { print "\tFound upgrade script from $1 to $2.\n" unless ($quiet); $upgrade{$1}{sql} = $dir.$file; } elsif ($3 eq "pl") { print "\tFound upgrade executable from $1 to $2.\n" unless ($quiet); - $upgrade{$1}{pl} = $dir.$file; + $upgrade{$1}{pl} = $file; } $upgrade{$1}{from} = $1; $upgrade{$1}{to} = $2; @@ -223,6 +224,13 @@ foreach $config (keys %config) { } else { print "Failed!\n" unless ($quiet); } + if ($upgrade{$upgrade}{pl} ne "") { + my $cmd = "cd ../docs/upgrades;perl ".$upgrade{$upgrade}{pl}." --configFile=".$config; + $cmd .= " --quiet" if ($quiet); + if (system($cmd)) { + print "\tProcessing upgrade executable failed!\n"; + } + } $config{$config}{version} = $upgrade{$upgrade}{to}; $notRun = 0; }