PHP Class ScheduleModel, thinksns

Datei anzeigen Open project: medz/thinksns-4

Public Methods

Method Description
addSchedule ( $schedule = '' ) @return bool
calculateNextRunTime ( $schedule ) @return: 'Y-m-d H:i:s'
cleanCache ( ) 清除缓存
delSchedule ( $ids ) 删除计划任务
getLogPath ( ) * Setter & Getter
getSchedule ( )
getScheduleList ( ) @return array()
isValidSchedule ( $schedule = '' ) 判断一个schedule是否有效
run ( ) 继承实现父类函数
runSchedule ( $schedule ) 执行任务计划
runScheduleList ( $scheduleList ) 执行计划任务列表
saveSchedule ( $schedule = '' ) 更新一条任务计划
setDirlist ( $dirlist )
setEndDateTime ( $end_datetime )
setLastRunTime ( $last_run_time )
setModifier ( $modifier )
setMonth ( $month )
setSchedule ( $schedule )
setScheduleType ( $schedule_type )
setStartDateTime ( $start_datetime )
setTaskToRun ( $task_to_run )

Protected Methods

Method Description
_calculateDAILY ( $schedule )
_calculateHOURLY ( $schedule )
_calculateMINUTE ( $schedule )
_calculateMONTHLY ( $schedule )
_calculateONCE ( $schedule ) * 根据计划频率计算一个schedule的下次执行时间
_calculateWEEKLY ( $schedule )
_checkDAILY ( $schedule )
_checkHOURLY ( $schedule )
_checkMINUTE ( $schedule )
_checkMONTHLY ( $schedule )
_checkONCE ( $schedule ) 根据计划频率检查一个schedule是否合法
_checkWEEKLY ( $schedule )
_getMonthDif ( $date1, $date2 = '' ) 返回自2007年01月01日来的月数
_getStartDateTime ( $schedule ) @return timestamp
_getWeekID ( $date = '' ) 返回自2007年01月01日来的周数
_isDayIDOfMonth ( $key, $date = '' ) 判断当前日期是否为当前月的第x个星期x
_isLastDayOfMonth ( $date = '' ) 判断当前日期是否为当前月的最后一天
_log ( $str ) 知识文件
setSecondToZero ( $date_time = null ) 将给定时间的秒数置为0; 参数为空时,使用当前时间

Private Methods

Method Description
fill_params ( $params = '' ) 组装参数
format_params ( $params ) 格式化参数

Method Details

_calculateDAILY() protected method

protected _calculateDAILY ( $schedule )

_calculateHOURLY() protected method

protected _calculateHOURLY ( $schedule )

_calculateMINUTE() protected method

protected _calculateMINUTE ( $schedule )

_calculateMONTHLY() protected method

protected _calculateMONTHLY ( $schedule )

_calculateONCE() protected method

* 根据计划频率计算一个schedule的下次执行时间
protected _calculateONCE ( $schedule )

_calculateWEEKLY() protected method

protected _calculateWEEKLY ( $schedule )

_checkDAILY() protected method

protected _checkDAILY ( $schedule )

_checkHOURLY() protected method

protected _checkHOURLY ( $schedule )

_checkMINUTE() protected method

protected _checkMINUTE ( $schedule )

_checkMONTHLY() protected method

protected _checkMONTHLY ( $schedule )

_checkONCE() protected method

根据计划频率检查一个schedule是否合法
protected _checkONCE ( $schedule )

_checkWEEKLY() protected method

protected _checkWEEKLY ( $schedule )

_getMonthDif() protected method

返回自2007年01月01日来的月数
protected _getMonthDif ( $date1, $date2 = '' )

_getStartDateTime() protected method

@return timestamp
protected _getStartDateTime ( $schedule )

_getWeekID() protected method

返回自2007年01月01日来的周数
protected _getWeekID ( $date = '' )

_isDayIDOfMonth() protected method

判断当前日期是否为当前月的第x个星期x
protected _isDayIDOfMonth ( $key, $date = '' )

_isLastDayOfMonth() protected method

判断当前日期是否为当前月的最后一天
protected _isLastDayOfMonth ( $date = '' )

_log() protected method

知识文件
protected _log ( $str )

addSchedule() public method

@return bool
public addSchedule ( $schedule = '' )

calculateNextRunTime() public method

@return: 'Y-m-d H:i:s'
public calculateNextRunTime ( $schedule )

cleanCache() public method

清除缓存
public cleanCache ( )

delSchedule() public method

删除计划任务
public delSchedule ( $ids )

getLogPath() public method

* Setter & Getter
public getLogPath ( )

getSchedule() public method

public getSchedule ( )

getScheduleList() public method

@return array()
public getScheduleList ( )

isValidSchedule() public method

判断一个schedule是否有效
public isValidSchedule ( $schedule = '' )

run() public method

继承实现父类函数
public run ( )

runSchedule() public method

执行任务计划
public runSchedule ( $schedule )

runScheduleList() public method

执行计划任务列表
public runScheduleList ( $scheduleList )

saveSchedule() public method

更新一条任务计划
public saveSchedule ( $schedule = '' )

setDirlist() public method

public setDirlist ( $dirlist )

setEndDateTime() public method

public setEndDateTime ( $end_datetime )

setLastRunTime() public method

public setLastRunTime ( $last_run_time )

setModifier() public method

public setModifier ( $modifier )

setMonth() public method

public setMonth ( $month )

setSchedule() public method

public setSchedule ( $schedule )

setScheduleType() public method

public setScheduleType ( $schedule_type )

setSecondToZero() protected method

将给定时间的秒数置为0; 参数为空时,使用当前时间
protected setSecondToZero ( $date_time = null )

setStartDateTime() public method

public setStartDateTime ( $start_datetime )

setTaskToRun() public method

public setTaskToRun ( $task_to_run )