Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 629 Bytes

cronjob.md

File metadata and controls

32 lines (24 loc) · 629 Bytes

Cronjob

Introduction

With the Cronjob service you can manage your cronjobs in the Applications itself. All you have to do is execute the php console tinyframework:cronjob command once a minute.

Setup

Tag your cronjobs with cronjob and implement the CronjobInterface.

container()->tag('cronjob', [MyCronjob::class]);
class MyCronjob implements \TinyFramework\Cron\CronjobInterface
{

    public function expression(): string
    {
        return '@daily';
    }

    public function handle(): void
    {
        // do what ever you want once a day
    }

}