PHPackages                             lekoala/silverstripe-simple-jobs - 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. lekoala/silverstripe-simple-jobs

ActiveSilverstripe-module[Queues &amp; Workers](/categories/queues)

lekoala/silverstripe-simple-jobs
================================

Simple Jobs for SilverStripe CMS

2.2.2(1y ago)23.1k↓50%1MITPHPPHP ^8CI passing

Since Jun 1Pushed 1y ago2 watchersCompare

[ Source](https://github.com/lekoala/silverstripe-simple-jobs)[ Packagist](https://packagist.org/packages/lekoala/silverstripe-simple-jobs)[ GitHub Sponsors](https://github.com/lekoala)[ RSS](/packages/lekoala-silverstripe-simple-jobs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (17)Used By (0)

SilverStripe Simple Jobs
========================

[](#silverstripe-simple-jobs)

[![Build Status](https://github.com/lekoala/silverstripe-simple-jobs/actions/workflows/ci.yml/badge.svg)](https://github.com/lekoala/silverstripe-simple-jobs/actions/workflows/ci.yml/badge.svg)[![scrutinizer](https://camo.githubusercontent.com/4230a002863b4abd0fd8a074dfe2cbe7298362e4a1a3e6eb1b9d753571c0f81c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c656b6f616c612f73696c7665727374726970652d73696d706c652d6a6f62732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/lekoala/silverstripe-simple-jobs/)[![Code coverage](https://camo.githubusercontent.com/e16891b61dd159e803e6ebb8d262bb20710f716d9a221942663b372fa76e80ff/68747470733a2f2f636f6465636f762e696f2f67682f6c656b6f616c612f73696c7665727374726970652d73696d706c652d6a6f62732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/lekoala/silverstripe-simple-jobs)

An alternative to run cron jobs that uses simple HTTP requests.

This module require [SilverStripe CronTask](https://github.com/silverstripe-labs/silverstripe-crontask).

Why?
====

[](#why)

Configuring cron jobs is painful. Maybe you don't have proper access to your server, or maybe it's difficult to make sure that php is run under the right user. This is why you can simply rely on an external service to trigger a HTTP request to a given script that will take care of any task you have to run.

How to setup
============

[](#how-to-setup)

Using an external service
-------------------------

[](#using-an-external-service)

Simply call every 5 minutes the following url : yoursite.com/simple-jobs/trigger

In order to do that, you can use for example [UptimeRobot](https://uptimerobot.com/). As an added bonus, will you monitor if your webserver is responding which is always nice to have :-).

Using your own requests
-----------------------

[](#using-your-own-requests)

Don't like using a service like UptimeRobot ? Feel free to setup your own http requets using [Windows Scheduled Tasks](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc748993(v=ws.11)) or another server using cron.

For instance

```
* * * * * wget -O - http://yoursite.com/simple-jobs/trigger >/dev/null 2>&1

```

Using regular cron jobs
-----------------------

[](#using-regular-cron-jobs)

You can also use this module similarly to the base crontask module, while getting all the logging benefits.

Add the following command to your cron definition:

```
* * * * * www-data /usr/bin/php /path/to/silverstripe/docroot/framework/cli-script.php simple-jobs/trigger

```

Enabling BasicAuth
==================

[](#enabling-basicauth)

To prevent malicious users to hammer your website by calling the url, you can enable BasicAuth. Define the following in your config file:

```
LeKoala\SimpleJobs\SimpleJobsController:
    username: "myusername"
    password: "mypassword"
```

And make sure that the proper headers are sent by UptimeRobot or any system you use to trigger HTTP requests.

Testing
=======

[](#testing)

You can also test your tasks by visiting yoursite.com/simple-jobs/.

This is enabled only if Dev mode is active. You can click on any task in the list, and choose to run it according to its schedule or force the task to run.

If needed, you can also trigger manually your jobs. Simply visit /simple-jobs/trigger\_manual/YourClass.

Log results
===========

[](#log-results)

As an added bonus, this module will by default log all results returned by the process() method. It will be stored in the database for further analysis.

Any task returning "false" will be marked as Failed.

Any task that triggers an exception will be marked as Failed and the Exception will be stored as the result. This has also the side benefit of allowing other tasks to be run even if one of them raise an exception.

Predefined schedules
====================

[](#predefined-schedules)

If you don't like the cron syntax, you can also use any constant from the SimpleJobSchedules class, that provides sane defaults for most common schedules.

```
class TestCron implements CronTask {

    /**
    * run this task every every day
    *
    * @return string
    */
    public function getSchedule() {
        return SimpleJobsSchedules::EVERY_DAY;
    }

    /**
    *
    * @return void
    */
    public function process() {
        echo 'hello';
    }
}
```

It also comes with two methods: everyDay and everyWeek, that allow you to define the task to run on a specific hour or day in the week. This is useful if you have multiple daily or weekly task and that you don't want to run them at the same time (because it could cause a timeout).

Simple Tasks
============

[](#simple-tasks)

This module also has a limited job runner feature in form of the `SimpleTask` class. A simple task is simply a delayed call to a given method on a given `DataObject`. You can pass any number of json serializable parameters (not object instances, for example).

```
$task = new SimpleTask();

$task->addToTask($this, "removeStuff", [
    $some_stuff_id,
]);
```

One simple task can have many calls to any number of methods on any number of object instances. Keep in mind that the `SimpleJobsController` will only run one task each time (every 5 minutes or less depending on how you configured the module), so you may want to group in one simple task everything that is related to one specific process.

Cleaning sessions
=================

[](#cleaning-sessions)

Since we have the session-manager, we need to [clean sessions](https://github.com/silverstripe/silverstripe-session-manager#garbage-collection).

This module does it for you automatically daily. This can be disabled:

```
LeKoala\SimpleJobs\SimpleJobsDailyTask:
    clean_sessions: false
```

Compatibility
=============

[](#compatibility)

Tested with 5+

Maintainer
==========

[](#maintainer)

LeKoala -

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance41

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% 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 ~155 days

Recently: every ~192 days

Total

16

Last Release

573d ago

Major Versions

1.0.1 → 2.0.02021-09-07

1.0.4 → 2.0.22022-02-16

1.0.5 → 2.0.32022-07-04

1.x-dev → 2.1.02023-06-22

PHP version history (5 changes)1.0.0PHP &gt;=5.4.8

2.0.0PHP &gt;=5.6

2.0.1PHP &gt;=7.2

2.1.0PHP ^7.4 || ^8.0

2.2.0PHP ^8

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/250762?v=4)[Thomas Portelange](/maintainers/lekoala)[@lekoala](https://github.com/lekoala)

---

Top Contributors

[![lekoala](https://avatars.githubusercontent.com/u/250762?v=4)](https://github.com/lekoala "lekoala (68 commits)")[![micschk](https://avatars.githubusercontent.com/u/1005986?v=4)](https://github.com/micschk "micschk (1 commits)")

---

Tags

cronmoduleschedulesilverstripetasksilverstripecroncmsmodulejobs

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/lekoala-silverstripe-simple-jobs/health.svg)

```
[![Health](https://phpackages.com/badges/lekoala-silverstripe-simple-jobs/health.svg)](https://phpackages.com/packages/lekoala-silverstripe-simple-jobs)
```

###  Alternatives

[lekoala/silverstripe-cms-actions

Add actions to your models in SilverStripe

39279.9k22](/packages/lekoala-silverstripe-cms-actions)[symbiote/silverstripe-queuedjobs

A framework for defining and running background jobs in a queued manner

56854.2k83](/packages/symbiote-silverstripe-queuedjobs)[lekoala/silverstripe-mandrill

Adds mandrill in the SilverStripe CMS

1827.3k](/packages/lekoala-silverstripe-mandrill)[axyr/silverstripe-adminlogin

Use a custom login screen to log in to the admin section

165.8k](/packages/axyr-silverstripe-adminlogin)

PHPackages © 2026

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