Merge pull request #29 from nhorstmeier/patch-1

BUGFIX DailyTask Deprecation
This commit is contained in:
Daniel Hensby 2014-11-03 08:01:47 +00:00
commit 50f086fe10
2 changed files with 4 additions and 5 deletions

View File

@ -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.

View File

@ -12,7 +12,7 @@
*
* @package multiform
*/
class MultiFormPurgeTask extends DailyTask {
class MultiFormPurgeTask extends BuildTask {
/**
* Days after which sessions expire and
@ -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) {