Download the PHP package hbalkhi/yii2-scheduler without Composer
On this page you can find all versions of the php package hbalkhi/yii2-scheduler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-scheduler
yii2-scheduler
A scheduled task manager for Yii2 applications. Easily schedule and manage recurring tasks with a user-friendly interface and CLI commands.
Installation
The preferred way to install this extension is through composer.
Install using the following command:
After installing the package, you need to configure the module in your application.
Configuration
Update your config/console.php file:
Also add this to the top of your config/console.php file to handle scheduler events:
To use the scheduler GUI in your web application, add this to your config/web.php:
After configuration, create a tasks directory in your project root and run the migrations to set up the database tables:
GUI Controller
To enable the scheduler GUI in your admin panel, create a controller like this:
Creating Tasks
Create task files in your project's tasks directory. All task class names must end with Task.
Example Task
Create AlphabetTask.php in your tasks directory:
The $schedule property uses Cron Expression syntax. In the example above, the task runs at the start of every hour.
Running the tasks
Scheduler provides an intuitive CLI for executing tasks, below are some examples
In order to have your tasks run automatically simply setup a crontab like so
Events
Events are triggered before and after task execution at both the task and global level.
Task Level
Global Level
You could throw the exceptions at the task level, however this will prevent further tasks from running.
License
The MIT License (MIT). Please see LICENSE for more information.
All versions of yii2-scheduler with dependencies
yiisoft/yii2 Version ^2.0.9
dragonmantank/cron-expression Version ~3.3.3
webtoolsnz/yii2-widgets Version *