BUGFIX DailyTask Deprecation

This commit is contained in:
muskie9 2014-10-23 09:44:12 -05:00
parent cfe6024171
commit 2471fa165b
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 expiry can be customised, and is given a default of 7 days to delete sessions
after their creation. 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 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).
cli-script.php automated tasks which are included with SilverStripe.
One way of automatically running this on a UNIX based machine is by cron. One way of automatically running this on a UNIX based machine is by cron.

View File

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