PHPackages                             shideon/tasker - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. shideon/tasker

ActiveLibrary[Queues &amp; Workers](/categories/queues)

shideon/tasker
==============

A simple job scheduler

0.1.5(12y ago)962[3 issues](https://github.com/shideon/tasker/issues)PHPPHP &gt;=5.4.0

Since Apr 22Pushed 7y ago1 watchersCompare

[ Source](https://github.com/shideon/tasker)[ Packagist](https://packagist.org/packages/shideon/tasker)[ RSS](/packages/shideon-tasker/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (6)Versions (8)Used By (0)

Tasker
======

[](#tasker)

**This was built *years* ago, but never saw the light of day. I'd likely change it up before using it myself so you should probably avoid it =P.**

Tasker is a simple PHP job scheduler that allows you to specify when your application's jobs should run by using a familiar cron syntax. The benefit is that your app's jobs and the times they run are managed inside your application instead of them living in a crontab (or equivalent) which lies outside of your application.

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c23b89220c74ca0f726c349862e5ef152d531bd604bdba140a4fb4b447a43d0e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73686964656f6e2f7461736b65722f6261646765732f7175616c6974792d73636f72652e706e673f733d66393432323237313338363033616636373266323631656666623832383432616530306431643261)](https://scrutinizer-ci.com/g/shideon/tasker/)

Requirements
------------

[](#requirements)

- \*nix
- PHP 5.4

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

[](#installation)

The bundle should be installed using [composer](https://getcomposer.org).

**Add the lib to your composer.json file**

```
{
    "require": {
        "shideon/tasker": "~0.1",
    }
}
```

Usage
-----

[](#usage)

Tasker is simple. Create a cron job (or equivalent) that runs the tasker command every minute. The command requires 2 options. `--config_file` which is a path to your file that contains the jobs to run and `--log_file` which is where notices get sent to.

**Config file - /path/to/config.yml**

```
tasker:
    tasks:
       - name: "My midnight job"
         time: "0 0 * * *"
         command: "sleep 10"
       - name: "My every other minute job"
         time: "*/2 * * * *"
         class: "My\Fkn\Class"
```

**Crontab**

```
* * * * * /path/to/tasker/bin/console shideon:tasker --config_file=/path/to/config.yml --log_file=/path/to/log
```

When tasker runs it will loop the jobs and determine if they're due to run and if they are then tasker will execute them in the background.

Configuration &amp; Jobs
------------------------

[](#configuration--jobs)

The config section begins with "tasker", then "tasks" where we define our jobs.

Each job may contain the following values:

- **name** (required) - A unique name for the job.
- **time** (required) - The time the job should run. Any legal cron expression is accepted.
- *Either...*
    - **command** - A command to execute on the sysetm. There is also the special keyword `$console` which translates to the same console that the tasker command was executed from. So the following string `$console my:command --my-option` would be translated to `/path/to/tasker/bin/console my:command --my-option`. *The console in the lib is only aware of the 2 internal lib commands. For more on customizing this, see Symfony's docs for the [console component](http://symfony.com/doc/current/components/console/introduction.html).*
    - **class** - A class to run. The class must implement the `Shideon\Tasker\TaskInterface` interface. If the lib isn't aware of your class' namespace you can use the `file` config value below.
- **file** - Used to specify the file that the above `class` resides in. The file will be `require`d before the class is called on.

Logging
-------

[](#logging)

Tasker uses [monolog](https://github.com/Seldaek/monolog) to handle logging and it logs to the file that you specify with the `--log_file` option.

The lib creares a `StreamHandler` handler at a log level of `INFO (200)`. You can also pass the `--log_level` option to define the level of logging you want. It must be a number and be equal to one of the class' [log level constants](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Logger.php#L29).

There is currently no way to define different or additional handlers for the logging as it would be extra work to handle from CLI. You can see the `Extending` section though.

Extending
---------

[](#extending)

The commands `TaskerCommand` (shideon:tasker) and `RunTaskCommand` (shideon:tasker:run\_task) are easily extensible. The most common reason to do this will be to instantiate monolog using custom functionality (which can be done by extending the command and defining your own `buildLogger()` method).

If doing this, remember that `bin/console` will not be aware of your new commands. You will probably want to create a new console that loads your commands then have your system's scheduler call on that instead of the default console. For more on this, see Symfony's docs for the [console component](http://symfony.com/doc/current/components/console/introduction.html).

Copyright
---------

[](#copyright)

Copyright (c) 2014 John Pancoast

License
-------

[](#license)

The MIT License (MIT)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

4406d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f46eb5a3f4df208370087b311d538513d057b2adf82ad896cfe216e592449380?d=identicon)[johnpancoast](/maintainers/johnpancoast)

---

Top Contributors

[![johnpancoast](https://avatars.githubusercontent.com/u/87027?v=4)](https://github.com/johnpancoast "johnpancoast (11 commits)")

### Embed Badge

![Health badge](/badges/shideon-tasker/health.svg)

```
[![Health](https://phpackages.com/badges/shideon-tasker/health.svg)](https://phpackages.com/packages/shideon-tasker)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

53541.0k3](/packages/jolicode-castor)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
