Properties

$data

$data : mixed

数据

Type

mixed

$id

$id : string

任务唯一ID

Type

string

$type

$type : string

任务类型

\Imi\Cron\Consts\CronTaskType 类常量

Type

string

$force

$force : boolean

每次启动服务强制执行

Type

boolean

$year

$year : string

指定任务执行年份,默认为 ** - 不限制 2019 - 指定年 2019-2022 - 指定年份区间 2019,2021,2022 - 指定多个年份 2n - 每 2 年,其它以此类推

Type

string

$month

$month : string

指定任务执行月份,默认为 ** - 不限制 1 (1 月), -1 (12 月) - 指定月份,支持负数为倒数的月 1-6 (1-6 月), -3--1 (10-12 月) - 指定月份区间,支持负数为倒数的月 1,3,5,-1 (1、3、5、12 月) - 指定多个月份,支持负数为倒数的月 2n - 每 2 个月,其它以此类推

Type

string

$day

$day : string

指定任务执行日期,默认为 ** - 不限制 1 (1 日), -1 (每月最后一天) - 指定日期,支持负数为倒数的日期 1-6 (1-6 日), -3--1 (每月倒数 3 天) - 指定日期区间,支持负数为倒数的日期 1,3,5,-1 (每月 1、3、5、最后一天) - 指定多个日期,支持负数为倒数的日期 2n - 每 2 天,其它以此类推 year 1 (一年中的第 1 日), year -1 (每年最后一天) - 指定一年中的日期,支持负数为倒数的日期 year 1-6 (一年中的第 1-6 日), year -3--1 (每年倒数 3 天) - 指定一年中的日期区间,支持负数为倒数的日期 year 1,3,5,-1 (每年 1、3、5、最后一天) - 指定一年中的多个日期,支持负数为倒数的日期

Type

string

$week

$week : string

周几

指定周几执行任务,默认为 ** - 不限制 1 (周一), -1 (周日) - 指定周几(1-7),支持负数为倒数的周 1-6 (周一到周六), -3--1 (周五到周日) - 指定周几,支持负数为倒数的周 1,3,5,-1 (周一、三、五、日) - 指定多个日期,支持负数为倒数的周

Type

string

$hour

$hour : string

小时

指定任务执行小时,默认为 ** - 不限制 0 (0 点), -1 (23 点) - 指定小时,支持负数为倒数的小时 1-6 (1-6 店), -3--1 (21-23 点) - 指定小时区间,支持负数为倒数的小时 1,3,5,-1 (1、3、5、23 点) - 指定多个小时,支持负数为倒数的小时 2n - 每 2 小时,其它以此类推

Type

string

$minute

$minute : string

分钟

指定任务执行分钟,默认为 ** - 不限制 0 (0 分), -1 (23 分) - 指定分钟,支持负数为倒数的分钟 1-6 (1-6 分), -3--1 (57-59 分) - 指定分钟区间,支持负数为倒数的分钟 1,3,5,-1 (1、3、5、59 分) - 指定多个分钟,支持负数为倒数的分钟 2n - 每 2 分钟,其它以此类推

Type

string

$second

$second : string

指定任务执行秒,默认为 ** - 不限制 0 (0 秒), -1 (23 秒) - 指定秒,支持负数为倒数的秒 1-6 (1-6 秒), -3--1 (57-59 秒) - 指定秒区间,支持负数为倒数的秒 1,3,5,-1 (1、3、5、59 秒) - 指定多个秒,支持负数为倒数的秒 2n - 每 2 秒,其它以此类推

Type

string

$unique

$unique : string|null

定时任务唯一性设置 当前实例唯一: current 所有实例唯一: all 不唯一: null

Type

string|null

$redisPool

$redisPool : string

用于锁的 `Redis` 连接池名

Type

string

$lockWaitTimeout

$lockWaitTimeout : float

获取锁超时时间,单位:秒

Type

float

$maxExecutionTime

$maxExecutionTime : float

最大运行执行时间,单位:秒。

该值与分布式锁超时时间共享,默认为 60 秒

Type

float

$defaultFieldName

$defaultFieldName : string

只传一个参数时的参数名

Type

string

Methods

__construct()

__construct(  $data = array()) 

Parameters

$data

offsetGet()

offsetGet(  $offset) 

Parameters

$offset

__wakeup()

__wakeup() 

offsetExists()

offsetExists(  $offset) 

Parameters

$offset

offsetSet()

offsetSet(  $offset,   $value) 

Parameters

$offset
$value

offsetUnset()

offsetUnset(  $offset) 

Parameters

$offset

current()

current() 

key()

key() 

next()

next() 

rewind()

rewind() 

valid()

valid() 

__set()

__set(  $name,   $value) 

Parameters

$name
$value

__get()

__get(  $name) 

Parameters

$name

__isset()

__isset(  $name) 

Parameters

$name

__unset()

__unset(  $name) 

Parameters

$name

toArray()

toArray() : array

将当前对象作为数组返回

Returns

array

jsonSerialize()

jsonSerialize() : array

json 序列化

Returns

array