namespace \webfiori\framework\cron
class Cron
Class Methods Summary
Class Methods Details
Parameters:
Parameters:
- string $time A time in the form 'hh:mm'. hh can have any value between 0 and 23 inclusive. mm can have any value between 0 and 59 inclusive.
- string $name An optional name for the job. Can be null.
- callable $func A function that will be executed once it is the time to run the job.
- array $funcParams An optional array of parameters which will be passed to the callback that will be executed when its time to execute the job.
Parameters:
- boolean $bool If set to true, a log file that contains the details of the executed jobs will be created in 'logs' folder. Default value is null.
Parameters:
- string $jobName The name of the job.
Returns the array that contains logged messages. The array will contain the messages which where logged using the method
Cron::log()
Creates routes to cron web interface pages. This method is used to initialize the following routes:
- /cron
- /cron/login
- /cron/apis/{action}
- /cron/jobs
- /cron/jobs/{job-name}
Parameters:
- string $message A string that act as a log message. It will be appended as passed without any changes.
Parameters:
- int $dayNumber The day of the month at which the job will be executed on. It can have any value between 1 and 31 inclusive.
- string $time A string that represents the time of the day that the job will execute on. The format of the time must be 'HH:MM'. where HH can have any value from '00' up to '23' and 'MM' can have any value from '00' up to '59'.
- string $name The name of cron job.
- callable $func A function that will be executed when its time to run the job.
- array $funcParams An optional array of parameters which will be passed to job function.
Parameters:
- string $pass If not null, the password will be updated to the given one.
Parameters:
- string $pass If cron password is set, this value must be provided. The given value will be hashed inside the body of the method and then compared with the password which was set. Default is empty string.
- string|null $jobName An optional job name. If specified, only the given job will be checked. Default is null.
- boolean $force If this attribute is set to true and a job name was provided, the job will be forced to execute. Default is false.
- CronCommand $command If cron is run from CLI, this parameter is provided to set custom execution attributes of a job.
- total-jobs: Total number of scheduled jobs.
- executed-count: Number of executed jobs.
- successfully-completed: Number of successfully completed jobs.
- failed: Number of jobs which did not finish successfully.
Parameters:
- AbstractJob $job An instance of the class 'AbstractJob'.
Parameters:
- int $dayOfMonth The number of day. 1 for the first day of month and 31 for the last day of the month.
Parameters:
- int $val Numeric representation of the day of the week. 0 for Sunday through 6 for Saturday.
Parameters:
- int $hour The number of hour. Can be any value between 1 and 23 inclusive.
Parameters:
- int $minute The number of the minute. Can be any value from 1 to 59.
Parameters:
- int $month The number of the month. Can be any value between 1 and 12 inclusive.
- 'YY' is month number.
- 'MM' is day number in the current month.
- 'HH' is the hour.
- 'MM' is the minute.
Parameters:
- string $time A string in the format 'd-hh:mm'. 'd' can be a number between 0 and 6 inclusive or a 3 characters day name such as 'sun'. 0 is for Sunday and 6 is for Saturday. 'hh' can have any value between 0 and 23 inclusive. mm can have any value between 0 and 59 inclusive.
- string $name An optional name for the job. Can be null.
- callable|null $func A function that will be executed once it is the time to run the job.
- array $funcParams An optional array of parameters which will be passed to the function.