migrated a few of the run hourly scripts
fixed a cron bug
This commit is contained in:
parent
a50a190642
commit
e04a1b6fca
25 changed files with 766 additions and 256 deletions
|
|
@ -1,4 +1,7 @@
|
|||
6.9.0
|
||||
- Added a workflow system.
|
||||
- Added a workflow scheduler system.
|
||||
- Converted the runHourly.pl scripts to run as scheduled workflows.
|
||||
- Converted WebGUI to use a new object oriented session system. More details
|
||||
in migation.txt.
|
||||
- Added a lot more tests to the test suite.
|
||||
|
|
|
|||
|
|
@ -7,15 +7,19 @@ upgrading from one version to the next, or even between multiple
|
|||
versions. Be sure to heed the warnings contained herein as they will
|
||||
save you many hours of grief.
|
||||
|
||||
6.9.0
|
||||
6.99.0
|
||||
--------------------------------------------------------------------
|
||||
* The 6.99 series is the last round of changes before 7.0.0 is
|
||||
released. It will serve as the beta, gamma, and release
|
||||
candidates for 7.0.0.
|
||||
|
||||
* The session system has been replaced by a new object-oriented one,
|
||||
which has caused massive API changes. Please consult
|
||||
migration.txt to bring your custom code up to date with the
|
||||
new API.
|
||||
|
||||
* You need to upgrade to the latest 6.8 release before you can
|
||||
upgrade to 6.9.
|
||||
upgrade to 6.99.
|
||||
|
||||
* If you wish to use one of the new optional template engines
|
||||
you'll need to install the perl modules for them:
|
||||
|
|
@ -43,6 +47,11 @@ save you many hours of grief.
|
|||
Don't be alarmed by this, it's a normal part of the upgrade
|
||||
procedure.
|
||||
|
||||
* You no longer need the cron job for runHourly.pl. Instead, you
|
||||
must start sbin/spectre.pl when your server starts up.
|
||||
Spectre is WebGUI's offline execution engine. It triggers
|
||||
scheduled events and executes workflow tasks.
|
||||
|
||||
|
||||
6.8.4
|
||||
--------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ be using this any longer anyway, but we thought we'd warn you anyway.
|
|||
|
||||
1.8 Output Chunking
|
||||
|
||||
Starting in 6.9 WebGUI www_ asset methods are capable of having full control
|
||||
Starting in 6.99 WebGUI www_ asset methods are capable of having full control
|
||||
over the output buffer. They can use $session->output->print() to send chunks
|
||||
of content back to the browser before the page is entirely processed. The
|
||||
advantage here is that the page appears to load more quickly to the end user.
|
||||
|
|
@ -275,10 +275,14 @@ take a look a WebGUI::Asset::Template for changes in the template system API.
|
|||
4. Scheduler Migration
|
||||
-----------------------
|
||||
|
||||
4.1 Nothing Yet
|
||||
|
||||
There have currently been no changes to the scheduler API.
|
||||
4.1 Converted to Workflow
|
||||
|
||||
As of 6.99 we've converted the scheduler (runHourly.pl) and it's plugins
|
||||
(sbin/Hourly/*) to the new WebGUI Workflow system. The program that replaces
|
||||
runHourly.pl is sbin/spectre.pl, which is always running and therefore doesn't
|
||||
need to be scheduled via crontab or Windows Scheduler. To see the new API for
|
||||
the sbin/Hourly/* scripts, check out
|
||||
lib/WebGUI/Workflow/Activity/_activity.skeleton
|
||||
|
||||
|
||||
5. System Changes Affecting Migration
|
||||
|
|
@ -564,7 +568,7 @@ Apache2::Request which is referenced through $session{modperl} and $session{req}
|
|||
|
||||
5.23 Session System Replaced
|
||||
|
||||
As of 6.9.0 we've removed the old global session system and replaced it with a
|
||||
As of 6.99 we've removed the old global session system and replaced it with a
|
||||
newer, safer, more modern, object oriented session system. Because session is
|
||||
the glue that holds WebGUI together, it has basically affected every API in
|
||||
the system. Here's a (hopefully complete) list of what's been changed and how
|
||||
|
|
@ -630,7 +634,7 @@ perl -pi.bak -e 's!\$session{scratch}{(.*)}!\$self->session->scratch->get("$1")!
|
|||
|
||||
5.23.1 WebGUI::SQL API Refactored
|
||||
|
||||
The SQL API has been made more object oriented in 6.9, so it now handles database
|
||||
The SQL API has been made more object oriented in 6.99, so it now handles database
|
||||
connections for you. You can get the default database connection via
|
||||
$session->db or a random slave via $session->dbSlave or you can create your
|
||||
own by my $db = WebGUI::SQL->connect($session, $dsn, $user, $pass);
|
||||
|
|
@ -654,14 +658,14 @@ perl -pi.bak -e 's!WebGUI\:\:FormProcessor\:\:!\$self->session->form->!g' fileNa
|
|||
|
||||
5.23.3 WebGUI::ErrorHandler API Refactored
|
||||
|
||||
As of 6.9 WebGUI::ErrorHandler is now accessed through session.
|
||||
As of 6.99 WebGUI::ErrorHandler is now accessed through session.
|
||||
|
||||
perl -pi.bak -e 's!WebGUI\:\:ErrorHandler\:\:!\$self->session->errorHandler->!g' fileNameGoesHere
|
||||
|
||||
|
||||
5.23.4 WebGUI::Style API Refactored
|
||||
|
||||
As of 6.9 the WebGUI::Style API has been convereted to OO and is accessed
|
||||
As of 6.99 the WebGUI::Style API has been convereted to OO and is accessed
|
||||
through session. The following command line tricks will help you convert your
|
||||
assets.
|
||||
|
||||
|
|
@ -679,14 +683,14 @@ perl -pi.bak -e 's!WebGUI\:\:Macro\:\:process\((.*)\)!WebGUI::Macro::process(\$s
|
|||
|
||||
5.23.6 WebGUI::URL API Refactored
|
||||
|
||||
As of 6.9 WebGUI::URL is now accessed through session like $session->url
|
||||
As of 6.99 WebGUI::URL is now accessed through session like $session->url
|
||||
|
||||
perl -pi.bak -e 's!WebGUI\:\:URL\:\:!\$self->session->url->!g' fileNameGoesHere
|
||||
|
||||
|
||||
5.23.7 WebGUI::Cache API Refactored
|
||||
|
||||
As of 6.9 WebGUI::Cache requires you to pass in a reference to $session into
|
||||
As of 6.99 WebGUI::Cache requires you to pass in a reference to $session into
|
||||
the constructor.
|
||||
|
||||
perl -pi.bak -e 's!WebGUI\:\:Cache\-\>new\(!WebGUI::Cache->new(\$self->session,!g' fileNameGoesHere
|
||||
|
|
@ -694,7 +698,7 @@ perl -pi.bak -e 's!WebGUI\:\:Cache\-\>new\(!WebGUI::Cache->new(\$self->session,!
|
|||
|
||||
5.23.8 WebGUI::AdminConsole Refactored
|
||||
|
||||
As of 6.9 WebGUI::AdminConsole requires you to pass a reference to $session
|
||||
As of 6.99 WebGUI::AdminConsole requires you to pass a reference to $session
|
||||
into the constructor.
|
||||
|
||||
perl -pi.bak -e 's!WebGUI\:\:AdminConsole\-\>new\(!WebGUI::AdminConsole->new(\$self->session,!g' fileNameGoesHere
|
||||
|
|
@ -702,7 +706,7 @@ perl -pi.bak -e 's!WebGUI\:\:AdminConsole\-\>new\(!WebGUI::AdminConsole->new(\$s
|
|||
|
||||
5.23.9 WebGUI::DatabaseLink API Refactored
|
||||
|
||||
As of 6.9 WebGUI::DatabaseLink requires you to pass in a reference to
|
||||
As of 6.99 WebGUI::DatabaseLink requires you to pass in a reference to
|
||||
$session into the constructor. Also, the API has been heavily refactored to be
|
||||
more complete. Please see it's API docs for more info.
|
||||
|
||||
|
|
@ -712,7 +716,7 @@ perl -pi.bak -e 's!WebGUI\:\:DatabaseLink\-\>new\(!WebGUI::DatabaseLink->new(\$s
|
|||
5.23.10 WebGUI::Privilege API Refactored
|
||||
|
||||
WebGUI::Privilege is now accessed through session like $session->privilege as
|
||||
of 6.9.
|
||||
of 6.99.
|
||||
|
||||
perl -pi.bak -e 's!WebGUI\:\:Privilege\:\:!\$self->session->privilege->!g' fileNameGoesHere
|
||||
|
||||
|
|
@ -735,7 +739,7 @@ perl -pi.bak -e 's!WebGUI\:\:DateTime\:\:!\$self->session->datetime->!g' fileNam
|
|||
|
||||
5.23.12 WebGUI::Form API Refactored
|
||||
|
||||
In 6.9 the WebGUI::Form API was refactored to accept $session as the first
|
||||
In 6.99 the WebGUI::Form API was refactored to accept $session as the first
|
||||
parameter to each method.
|
||||
|
||||
perl -pi.bak -e 's!WebGUI\:\:Form\:\:(\w+)\((.*)\)!WebGUI::Form::$1(\$self->session,$2)!g' fileNameGoesHere
|
||||
|
|
|
|||
|
|
@ -97,16 +97,19 @@ sub addWorkflow {
|
|||
primary key (activityId, name)
|
||||
)");
|
||||
my $workflow = WebGUI::Workflow->create($session, {
|
||||
title=>"Clean Up Temp Files",
|
||||
description=>"This workflow deletes temporary files from the WebGUI uploads folder.",
|
||||
title=>"Daily Maintenance Tasks",
|
||||
description=>"This workflow runs daily maintenance tasks such as cleaning up old temporary files and cache.",
|
||||
enabled=>1,
|
||||
type=>"none"
|
||||
}, "pbworkflow000000000001");
|
||||
my $activity = $workflow->addActivity("WebGUI::Workflow::Activity::CleanTempStorage", "pbwfactivity0000000001");
|
||||
$activity->set("title","Delete files older than 24 hours");
|
||||
$activity->set("title","Delete temp files older than 24 hours");
|
||||
$activity->set("storageTimeout",60*60*24);
|
||||
my $cron = WebGUI::Workflow::Cron->create($session, {
|
||||
title=>'Delete temp files',
|
||||
$activity = $workflow->addActivity("WebGUI::Workflow::Activity::CleanFileCache", "pbwfactivity0000000002");
|
||||
$activity->set("title","Prune cache larger than 100MB");
|
||||
$activity->set("sizeLimit", 1000000000);
|
||||
WebGUI::Workflow::Cron->create($session, {
|
||||
title=>'Daily Maintenance',
|
||||
enabled=>1,
|
||||
runOnce=>0,
|
||||
minuteOfHour=>"30",
|
||||
|
|
@ -115,10 +118,40 @@ sub addWorkflow {
|
|||
workflowId=>$workflow->getId
|
||||
}, "pbcron0000000000000001");
|
||||
$session->config->set("workflowActivities", {
|
||||
none=>["WebGUI::Workflow::Activity::CleanTempStorage"],
|
||||
none=>["WebGUI::Workflow::Activity::DecayKarma", "WebGUI::Workflow::Activity::TrashClipboard", "WebGUI::Workflow::Activity::CleanTempStorage",
|
||||
"WebGUI::Workflow::Activity::CleanFileCache", "WebGUI::Workflow::Activity::CleanLoginHistory"],
|
||||
user=>[],
|
||||
versiontag=>[]
|
||||
versiontag=>["WebGUI::Workflow::Activity::CommitVersionTag", "WebGUI::Workflow::Activity::RollbackVersionTag"]
|
||||
});
|
||||
$workflow = WebGUI::Workflow->create($session, {
|
||||
title=>"Weekly Maintenance Tasks",
|
||||
description=>"This workflow runs once per week to perform maintenance tasks like cleaning up log files.",
|
||||
enabled=>1,
|
||||
type=>"none"
|
||||
}, "pbworkflow000000000002");
|
||||
$activity = $workflow->addActivity("WebGUI::Workflow::Activity::CleanLoginHistory", "pbwfactivity0000000003");
|
||||
$activity->set("title", "Delete login entries older than 90 days");
|
||||
$activity->set("ageToDelete", 60*60*24*90);
|
||||
$activity = $workflow->addActivity("WebGUI::Workflow::Activity::TrashClipboard", "pbwfactivity0000000004");
|
||||
$activity->set("title", "Move clipboard items older than 30 days to trash");
|
||||
$activity->set("trashAfter", 60*60*24*30);
|
||||
WebGUI::Workflow::Cron->create($session, {
|
||||
title=>'Weekly Maintenance Maintenance',
|
||||
enabled=>1,
|
||||
runOnce=>0,
|
||||
minuteOfHour=>"30",
|
||||
hourOfDay=>"1",
|
||||
dayOfWeek=>"0",
|
||||
priority=>3,
|
||||
workflowId=>$workflow->getId
|
||||
}, "pbcron0000000000000002");
|
||||
$session->db->write("alter table assetVersionTag add column isLocked int not null default 0");
|
||||
$session->db->write("alter table assetVersionTag add column lockedBy varchar(22) binary not null");
|
||||
$session->config->delete("fileCacheSizeLimit");
|
||||
$session->config->delete("CleanLoginHistory_ageToDelete");
|
||||
$session->config->delete("DecayKarma_minimumKarma");
|
||||
$session->config->delete("DecayKarma_decayFactor");
|
||||
$session->config->delete("DeleteExpiredClipboard_offset");
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue