PHPackages                             dukecity/command-scheduler-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. dukecity/command-scheduler-bundle

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

dukecity/command-scheduler-bundle
=================================

This Symfony bundle will allow you to schedule all your commands just like UNIX crontab

v6.0.15(3mo ago)25350.9k—6.8%26[12 issues](https://github.com/Dukecity/CommandSchedulerBundle/issues)[1 PRs](https://github.com/Dukecity/CommandSchedulerBundle/pulls)3MITPHPPHP &gt;=8.2CI passing

Since Sep 10Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/Dukecity/CommandSchedulerBundle)[ Packagist](https://packagist.org/packages/dukecity/command-scheduler-bundle)[ Docs](https://github.com/Dukecity/CommandSchedulerBundle)[ RSS](/packages/dukecity-command-scheduler-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (37)Versions (86)Used By (3)

CommandSchedulerBundle
======================

[](#commandschedulerbundle)

[![Code_Checks](https://github.com/Dukecity/CommandSchedulerBundle/actions/workflows/code_checks.yaml/badge.svg?branch=main)](https://github.com/Dukecity/CommandSchedulerBundle/actions/workflows/code_checks.yaml)[![codecov](https://camo.githubusercontent.com/c76c00924d0ab9e7bc4ff843d0a42eac064453275058107ac37e3ed23c943509/68747470733a2f2f636f6465636f762e696f2f67682f44756b65636974792f436f6d6d616e645363686564756c657242756e646c652f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d5633495a333551483944)](https://codecov.io/gh/Dukecity/CommandSchedulerBundle)[![CodeRabbit Pull Request Reviews](https://camo.githubusercontent.com/a167b9211ec5839810254b225f187b2f13e28c6f5311d335a7124b8d6dbfc4c5/68747470733a2f2f696d672e736869656c64732e696f2f636f64657261626269742f7072732f6769746875622f44756b65636974792f436f6d6d616e645363686564756c657242756e646c653f75746d5f736f757263653d6f73732675746d5f6d656469756d3d6769746875622675746d5f63616d706169676e3d44756b6563697479253246436f6d6d616e645363686564756c657242756e646c65266c6162656c436f6c6f723d31373137313726636f6c6f723d464635373041266c696e6b3d6874747073253341253246253246636f64657261626269742e6169266c6162656c3d436f64655261626269742b52657669657773)](https://camo.githubusercontent.com/a167b9211ec5839810254b225f187b2f13e28c6f5311d335a7124b8d6dbfc4c5/68747470733a2f2f696d672e736869656c64732e696f2f636f64657261626269742f7072732f6769746875622f44756b65636974792f436f6d6d616e645363686564756c657242756e646c653f75746d5f736f757263653d6f73732675746d5f6d656469756d3d6769746875622675746d5f63616d706169676e3d44756b6563697479253246436f6d6d616e645363686564756c657242756e646c65266c6162656c436f6c6f723d31373137313726636f6c6f723d464635373041266c696e6b3d6874747073253341253246253246636f64657261626269742e6169266c6162656c3d436f64655261626269742b52657669657773)

This bundle will allow you to easily manage scheduling for Symfony's console commands (native or not) with cron expression. See [Wiki](https://github.com/Dukecity/CommandSchedulerBundle/wiki) for Details

Versions &amp; Dependencies
---------------------------

[](#versions--dependencies)

Please read [Upgrade-News for Version 6](UPGRADE.md)

Version 7.x has the goal to use modern Php and Symfony features and low maintenance. So only PHP &gt;= 8.4 and Symfony ^8.0 are supported at the moment.

The following table shows the compatibilities of different versions of the bundle :

VersionSymfonyPHP[7.x (main)](https://github.com/Dukecity/CommandSchedulerBundle/tree/main)^8.0&gt;=8.4[6.x](https://github.com/Dukecity/CommandSchedulerBundle/tree/main)^7.0 + ^8.0&gt;=8.2[5.x](https://github.com/Dukecity/CommandSchedulerBundle/tree/5.x)^5.4 + ^6.0&gt;=8.0[4.x](https://github.com/Dukecity/CommandSchedulerBundle/tree/4.x)^4.4.20 + ^5.3&gt;=8.0[3.x](https://github.com/Dukecity/CommandSchedulerBundle/tree/3.x)^4.4.20 + ^5.3&gt;=7.3[2.2.x](https://github.com/Dukecity/CommandSchedulerBundle/tree/2.2)^3.4 + ^4.3^7.1Install
-------

[](#install)

When using Symfony Flex there is an [installation recipe](https://github.com/symfony/recipes-contrib/tree/main/dukecity/command-scheduler-bundle/3.0).
To use it, you have to enable contrib recipes on your project :

```
composer config extra.symfony.allow-contrib true
composer req dukecity/command-scheduler-bundle
```

#### Update Database

[](#update-database)

If you're using DoctrineMigrationsBundle (recommended way):

```
php bin/console make:migration
php bin/console doctrine:migrations:migrate
```

Without DoctrineMigrationsBundle:

```
php bin/console doctrine:schema:update --force
```

#### Install Assets

[](#install-assets)

```
php bin/console assets:install --symlink --relative public
```

#### Secure your route

[](#secure-your-route)

Add this line to your security config.

```
- { path: ^/command-scheduler, role: ROLE_ADMIN }

```

Check new URL /command-scheduler/list

Features and Changelog
----------------------

[](#features-and-changelog)

Please read [Changelog](CHANGELOG.md)

Screenshots
-----------

[](#screenshots)

[![list](Resources/doc/images/scheduled-list.png)](Resources/doc/images/scheduled-list.png)

[![new](Resources/doc/images/new-schedule.png)](Resources/doc/images/new-schedule.png)

[![new2](Resources/doc/images/command-list.png)](Resources/doc/images/command-list.png)

Extending the ScheduledCommand Entity
-------------------------------------

[](#extending-the-scheduledcommand-entity)

You can extend the default `ScheduledCommand` entity to add custom fields or behavior. The bundle uses a MappedSuperclass pattern with an interface for maximum flexibility.

### Creating a Custom Entity

[](#creating-a-custom-entity)

1. Create your custom entity extending `BaseScheduledCommand`:

```
