PHPackages                             panix/mod-scheduler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. panix/mod-scheduler

ActivePixelion-module[Utility &amp; Helpers](/categories/utility)

panix/mod-scheduler
===================

scheduler module

04PHP

Since Aug 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/andrtechno/mod-scheduler)[ Packagist](https://packagist.org/packages/panix/mod-scheduler)[ RSS](/packages/panix-mod-scheduler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-scheduler
==============

[](#yii2-scheduler)

[![Latest Stable Version](https://camo.githubusercontent.com/200c286a0c013077332fae3ab040d7c28ed9b896612a5d5eb522f706801843b9/68747470733a2f2f706f7365722e707567782e6f72672f70616e69782f6d6f642d7363686564756c65722f762f737461626c65)](https://packagist.org/packages/panix/mod-scheduler)[![Total Downloads](https://camo.githubusercontent.com/ec8fc041b42f482e217665ae2bc8b2440699dedcf7843ef65cba8ff84216581c/68747470733a2f2f706f7365722e707567782e6f72672f70616e69782f6d6f642d7363686564756c65722f646f776e6c6f616473)](https://packagist.org/packages/panix/mod-scheduler)[![Monthly Downloads](https://camo.githubusercontent.com/2bc510ac23d04d1238c6008bf084f62fbcd800add28e6e85e0a3cb39536e077e/68747470733a2f2f706f7365722e707567782e6f72672f70616e69782f6d6f642d7363686564756c65722f642f6d6f6e74686c79)](https://packagist.org/packages/panix/mod-scheduler)[![Daily Downloads](https://camo.githubusercontent.com/73b51f1ac05737288e148278454f6f22d32ec31180d4b86cdcda338bca26a1b8/68747470733a2f2f706f7365722e707567782e6f72672f70616e69782f6d6f642d7363686564756c65722f642f6461696c79)](https://packagist.org/packages/panix/mod-scheduler)[![Latest Unstable Version](https://camo.githubusercontent.com/2b33213687789dc8011b73cadbffb8cf06f672334e8e8280e17f673c0300616c/68747470733a2f2f706f7365722e707567782e6f72672f70616e69782f6d6f642d7363686564756c65722f762f756e737461626c65)](https://packagist.org/packages/panix/mod-scheduler)[![License](https://camo.githubusercontent.com/463b5c6d672dfa346116512fc95542efee280aef9646b6d3c96e4de227abd5b1/68747470733a2f2f706f7365722e707567782e6f72672f70616e69782f6d6f642d7363686564756c65722f6c6963656e7365)](https://packagist.org/packages/panix/mod-scheduler)

A scheduled task manager for yii2

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Install using the following command.

```
$ composer require panix/mod-scheduler
```

Now that the package has been installed you need to configure the module in your application

The `config/console.php` file should be updated to reflect the changes below

```
    'bootstrap' => ['log', 'scheduler'],
    'modules' => [
        'scheduler' => ['class' => 'panix\mod\scheduler\Module'],
    ],
    'components' => [
        'errorHandler' => [
            'class' => 'panix\mod\scheduler\ErrorHandler'
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\EmailTarget',
                    'mailer' =>'mailer',
                    'levels' => ['error', 'warning'],
                    'message' => [
                        'to' => ['admin@example.com'],
                        'from' => [$params['adminEmail']],
                        'subject' => 'Scheduler Error - ####SERVERNAME####'
                    ],
                    'except' => [
                    ],
                ],
            ],
        ],
    ]
```

also add this to the top of your `config/console.php` file

```
\yii\base\Event::on(
    \panix\mod\scheduler\console\SchedulerController::className(),
    \panix\mod\scheduler\events\SchedulerEvent::EVENT_AFTER_RUN,
    function ($event) {
        if (!$event->success) {
            foreach($event->exceptions as $exception) {
                throw $exception;
            }
        }
    }
);
```

To implement the GUI for scheduler also add the following to your `config/web.php`

```
    'bootstrap' => ['log', 'scheduler'],
    'modules' => [
        'scheduler' => ['class' => 'panix\mod\scheduler\Module'],
    ],
```

After the configuration files have been updated, a `tasks` directory will need to be created in the root of your project.

Run the database migrations, which will create the necessary tables for `scheduler`

```
php yii migrate up --migrationPath=vendor/webtoolsnz/yii2-scheduler/src/migrations
```

Add a controller

```
