All Projects → synolia → SyliusSchedulerCommandPlugin

synolia / SyliusSchedulerCommandPlugin

Licence: MIT license
Schedule Symfony Commands in your Sylius

Programming Languages

PHP
23972 projects - #3 most used programming language
Gherkin
971 projects
Twig
543 projects
Makefile
30231 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to SyliusSchedulerCommandPlugin

SyliusWishlistPlugin
This plugin allows you to integrate wishlist features with Sylius platform app.
Stars: ✭ 51 (+104%)
Mutual labels:  sylius, sylius-plugin
SyliusBannerPlugin
Add Banners to your Sylius projects with this plugin
Stars: ✭ 13 (-48%)
Mutual labels:  sylius, sylius-plugin
SyliusSettingsPlugin
Provide some custom settings to your favorite Sylius shop!
Stars: ✭ 17 (-32%)
Mutual labels:  sylius, sylius-plugin
SyliusPayUPlugin
PayU payment plugin for Sylius applications.
Stars: ✭ 21 (-16%)
Mutual labels:  sylius, sylius-plugin
SyliusAkeneoPlugin
This Sylius plugin allows you to import data from Akeneo PIM
Stars: ✭ 17 (-32%)
Mutual labels:  sylius, sylius-plugin
SyliusReportPlugin
Report Plugin for Sylius. This plugin add a report interface to the Sylius administration. Some reports comes with this bundle but you can create your custom reports.
Stars: ✭ 25 (+0%)
Mutual labels:  sylius, sylius-plugin
SyliusCmsPagePlugin
A Sylius plugin to manage your CMS pages
Stars: ✭ 26 (+4%)
Mutual labels:  sylius, sylius-plugin
CustomerOrderCancellationPlugin
Plugin that allows customers to cancel the placed order before it is processed.
Stars: ✭ 22 (-12%)
Mutual labels:  sylius, sylius-plugin
SyliusFeedPlugin
Create feeds in your Sylius shop
Stars: ✭ 20 (-20%)
Mutual labels:  sylius, sylius-plugin
CoopTilleulsSyliusClickNCollectPlugin
Sell and deliver securely during the COVID-19 pandemic!
Stars: ✭ 77 (+208%)
Mutual labels:  sylius, sylius-plugin
SyliusInvoicingPlugin
This plugin enables generating invoices in Sylius platform application.
Stars: ✭ 21 (-16%)
Mutual labels:  sylius, sylius-plugin
SyliusProductBundlePlugin
This plugin allows you to create new products by bundling existing products together.
Stars: ✭ 17 (-32%)
Mutual labels:  sylius-plugin
sitemap-plugin
Sitemap Plugin for Sylius eCommerce platform
Stars: ✭ 68 (+172%)
Mutual labels:  sylius
enhavo
Modern CMS with shop features based on fullstack symfony and sylius components
Stars: ✭ 80 (+220%)
Mutual labels:  sylius
Jedisjeux
Boardgames website, based on Symfony framework and Sylius.
Stars: ✭ 13 (-48%)
Mutual labels:  sylius
SyliusCustomOptionsPlugin
A Sylius plugin that adds customer options
Stars: ✭ 42 (+68%)
Mutual labels:  sylius
WebgriffeSyliusTableRateShippingPlugin
Sylius plugin which allows to define shipping rates using weight/rate tables.
Stars: ✭ 13 (-48%)
Mutual labels:  sylius
Sylius
Open Source eCommerce Platform on Symfony
Stars: ✭ 6,598 (+26292%)
Mutual labels:  sylius
BootstrapTheme
Sylius Bootstrap theme with build process based on Webpack Encore
Stars: ✭ 85 (+240%)
Mutual labels:  sylius
SyliusMolliePlugin
Sylius Mollie payment gateway integration.
Stars: ✭ 1 (-96%)
Mutual labels:  sylius

License Tests Version Total Downloads

Scheduler Command Plugin

Schedule Symfony Commands in your Sylius admin panel.

Commands list

Commands

Scheduled Commands list

Scheduled Commands

Features

  • See the list of planned command
  • Add, edit, enable/disable or delete scheduled commands
  • For each command, you have to define :
    • Name
    • Selected Command from the list of Symfony commands
    • Based on Cron schedule expression see Cron formats
    • Output Log file prefix (optional)
    • Priority (highest is priority)
  • Run the Command immediately (at the next passage of the command synolia:scheduler-run)
  • Run a Command juste one time (from history page clic on Launch a command button)
  • Download or live view of log files directly from the admin panel
  • Define commands with a Factory (from a Doctrine migration, for example)

Requirements

Version
PHP ^7.4, ^8.0
Sylius ^1.9

Installation

  1. Add the bundle and dependencies in your composer.json :

     composer config extra.symfony.allow-contrib true
     composer req synolia/sylius-scheduler-command-plugin
    
  2. Apply migrations to your database:

     bin/console doctrine:migrations:migrate
    
  3. Launch Run command in your Crontab

     * * * * * /_PROJECT_DIRECTORY_/bin/console synolia:scheduler-run
    
  4. (optional) Showing humanized cron expression

     composer require lorisleiva/cron-translator
    
  5. Till symfony/recipes-contrib is updated for the v3, you must add sylius_scheduler_command.yaml from install/Application/config/{packages,routes} to your project by respecting the same folder architecture.

     cp -R vendor/synolia/sylius-scheduler-command-plugin/install/Application/config/packages/* config/packages/
     cp -R vendor/synolia/sylius-scheduler-command-plugin/install/Application/config/routes/* config/routes/
    

Usage

  • Log into admin panel
  • Click on Scheduled commands in the Scheduled commands section in main menu to manage your Scheduled commands
  • Click on Scheduled commands history in the Scheduled commands section in main menu to see history of commands

Fixtures

Inside sylius fixture file config/packages/sylius_fixtures.yaml you can add scheduled command fixtures to your suite.

sylius_fixtures:
    suites:
        my_fixture_suite:
            fixtures:
                scheduler_command:
                    options:
                        scheduled_commands:
                            -
                                name: 'Reset Sylius'
                                command: 'sylius:fixtures:load'
                                cronExpression: '0 0 * * *'
                                logFilePrefix: 'reset'
                                priority: 0
                                enabled: true
                            -
                                name: 'Cancel Unpaid Orders'
                                command: 'sylius:cancel-unpaid-orders'
                                cronExpression: '0 0 * * *'
                                priority: 1
                                enabled: false

Commands

synolia:scheduler-run

Execute scheduled commands.

  • options:
    • --id (run only a specific scheduled command)

Run all scheduled commands : php bin/console synolia:scheduler-run

Run one scheduled command : php bin/console synolia:scheduler-run --id=5

synolia:scheduler:purge-history

Purge scheduled command history greater than {X} days old.

  • options:
    • --all (purge everything)
    • --days (number of days to keep)
    • --state (array of schedule states)
    • --dry-run

Example to remove all finished and in error scheduled commands after 7 days :

php bin/console synolia:scheduler:purge-history --state=finished --state=error --days=7

Optional services

services:
...
    # By enabling this service, it will be requested to vote after the other EveryMinuteIsDueChecker checker.
    # Using some cloud providers, even if the master cron is set to run every minute, it is actually not run that often
    # This service allows you to set a soft threshold limit, so if your provider is actually running the master cron every 5 minutes
    # This service will execute the cron if we are still in the threshold limit ONLY IF it was not already executed another time in the same range.
    #
    # CONFIGURATION SCENARIO: cron set to be run at 01:07 in the scheduler command plugin
    #
    # SCENARIO CASES AT 1 CRON PASS EVERY 5 MINUTES FROM THE PROVIDER
    # cron passes at 01:04 - 1..5 minutes: IS NOT DUE
    # cron passes at 01:05 - 1..5 minutes: IS NOT DUE
    # cron passes at 01:06 - 1..5 minutes: IS NOT DUE
    # cron passes at 01:07 - 1..5 minutes: IS DUE (but it should already be handled by EveryMinuteIsDueChecker)
    # cron passes at 01:08 - 1..5 minutes: IS DUE
    # cron passes at 01:09 - 1..5 minutes: IS DUE #should not if another has started during the threshold period
    # cron passes at 01:10 - 1..5 minutes: IS DUE #should not if another has started during the threshold period
    # cron passes at 01:11 - 1..5 minutes: IS DUE #should not if another has started during the threshold period
    # cron passes at 01:12 - 1..5 minutes: IS DUE #should not if another has started during the threshold period
    # cron passes at 01:13 - 1..5 minutes: IS NOT DUE
    Synolia\SyliusSchedulerCommandPlugin\Checker\SoftLimitThresholdIsDueChecker:
        tags:
            - { name: !php/const Synolia\SyliusSchedulerCommandPlugin\Checker\IsDueCheckerInterface::TAG_ID }
        #optionnal, default value is 5 minutes
        arguments:
            $threshold: 5 #soft limit threshold in minutes

Development

See How to contribute.

License

This library is under the MIT license.

Credits

Developed by Synolia.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].