mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 11:05:49 +02:00
Merge pull request #29 from nhorstmeier/patch-1
BUGFIX DailyTask Deprecation
This commit is contained in:
commit
50f086fe10
@ -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.
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user