PHPackages                             delormejonathan/cron-bundle - 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. [CLI &amp; Console](/categories/cli)
4. /
5. delormejonathan/cron-bundle

ActiveSymfony-bundle[CLI &amp; Console](/categories/cli)

delormejonathan/cron-bundle
===========================

This bundle provides scheduled execution of Symfony2 commands

03.6k↓50%PHP

Since Dec 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/delormejonathan/CronBundle)[ Packagist](https://packagist.org/packages/delormejonathan/cron-bundle)[ RSS](/packages/delormejonathan-cron-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ColourStream Cron Bundle
========================

[](#colourstream-cron-bundle)

This bundle provides a simple interface for registering repeated scheduled tasks within your application, including support for installs where the host does not allow for command-line access (TODO).

This bundle is tested only against Symfony 2.1. It will likely work with Symfony 2.0, but YMMV

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

[](#installation)

Installing this bundle can be done through these simple steps:

1. Add the bundle to your project as a composer dependency:

```
// composer.json
{
    // ...
    require: {
        // ...
        "colourstream/cron-bundle": "dev-master"
    }
}
```

2. Update your composer installation:

```
composer update
```

3. Add the bundle to your application kernel:

```
// application/ApplicationKernel.php
public function registerBundles()
{
	// ...
	$bundle = array(
		// ...
        new ColourStream\Bundle\CronBundle\ColourStreamCronBundle(),
	);
    // ...

    return $bundles;
}
```

4. Update your DB schema

```
app/console doctrine:schema:update
```

4. Start using the bundle:

```
app/console cron:scan
app/console cron:run
```

Running your cron jobs automatically
------------------------------------

[](#running-your-cron-jobs-automatically)

This bundle is designed around the idea that your tasks will be run with a minimum interval - the tasks will be run no more frequently than you schedule them, but they can only run when you trigger then (by running `app/console cron:run`, or the forthcoming web endpoint, for use with webcron services).

To facilitate this, you can create a cron job on your system like this:

```
*/5 * * * * /path/to/symfony/install/app/console cron:run

```

This will schedule your tasks to run at most every 5 minutes - for instance, tasks which are scheduled to run every 3 minutes will only run every 5 minutes.

Creating your own tasks
-----------------------

[](#creating-your-own-tasks)

Creating your own tasks with CronBundle couldn't be easier - all you have to do is create a normal Symfony2 Command (or ContainerAwareCommand) and tag it with the @CronJob annotation, as demonstrated below:

```
/**
 * @CronJob("PT1H")
 */
class DemoCommand extends Command
{
    public function configure()
    {
		// Must have a name configured
		// ...
    }

    public function execute(InputInterface $input, OutputInterface $output)
    {
		// Your code here
    }
}
```

The interval spec ("PT1H" in the above example) is documented on the [DateInterval](http://au.php.net/manual/en/dateinterval.construct.php) documentation page, and can be modified whenever you choose. For your CronJob to be scanned and included in future runs, you must first run `app/console cron:scan` - it will be scheduled to run the next time you run `app/console cron:run`

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 52.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.

### Community

Maintainers

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

---

Top Contributors

[![predakanga](https://avatars.githubusercontent.com/u/830645?v=4)](https://github.com/predakanga "predakanga (10 commits)")[![delormejonathan](https://avatars.githubusercontent.com/u/5949870?v=4)](https://github.com/delormejonathan "delormejonathan (8 commits)")[![yberkholz](https://avatars.githubusercontent.com/u/1708117?v=4)](https://github.com/yberkholz "yberkholz (1 commits)")

### Embed Badge

![Health badge](/badges/delormejonathan-cron-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/delormejonathan-cron-bundle/health.svg)](https://phpackages.com/packages/delormejonathan-cron-bundle)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.1k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)[codedungeon/php-cli-colors

Liven up you PHP Console Apps with standard colors

10210.1M26](/packages/codedungeon-php-cli-colors)

PHPackages © 2026

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