Skip to content

Commit

Permalink
Merge pull request #29 from nhorstmeier/patch-1
Browse files Browse the repository at this point in the history
BUGFIX DailyTask Deprecation
  • Loading branch information
dhensby committed Nov 3, 2014
2 parents cfe6024 + 2471fa1 commit 50f086f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,9 @@ task can be used to purge expired session data on a regular basis. The date of
expiry can be customised, and is given a default of 7 days to delete sessions
after their creation.

You can run the task from the URL, by using http://mysite.com/MultiFormPurgeTask/run
You can run the task from the URL, by using http://mysite.com/dev/tasks/MultiFormPurgeTask?flush=1

MultiFormPurgeTask is a subclass of *DailyTask*, so can be used alongside the
cli-script.php automated tasks which are included with SilverStripe.
MultiFormPurgeTask is a subclass of *BuildTask*, so can be , so can be run using the [SilverStripe CLI tools](http://doc.silverstripe.org/framework/en/topics/commandline).

One way of automatically running this on a UNIX based machine is by cron.

Expand Down
4 changes: 2 additions & 2 deletions code/tasks/MultiFormPurgeTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @package multiform
*/
class MultiFormPurgeTask extends DailyTask {
class MultiFormPurgeTask extends BuildTask {

/**
* Days after which sessions expire and
Expand All @@ -29,7 +29,7 @@ class MultiFormPurgeTask extends DailyTask {
* are older than the days specified in $session_expiry_days
* and delete them.
*/
public function process() {
public function run($request) {
$sessions = $this->getExpiredSessions();
$delCount = 0;
if($sessions) foreach($sessions as $session) {
Expand Down

0 comments on commit 50f086f

Please sign in to comment.