Git Product home page Git Product logo

syliusschedulercommandplugin's Introduction

Scheduler Command Plugin


Schedule Symfony Commands in your Sylius admin panel.

Capture

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 (optional)
    • Priority (highest is priority)
  • Run the Command immediately
  • Download, show file size, empty log files directly from the admin panel
  • Define commands with a Factory (from a Doctrine migration, for example)

Installation

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

    $ composer require synolia/sylius-scheduler-command-plugin
  2. Enable the plugin in your config/bundles.php file by add

    Synolia\SyliusSchedulerCommandPlugin\SynoliaSyliusSchedulerCommandPlugin::class => ['all' => true],
  3. Import required config in your config/packages/_sylius.yaml file:

    imports:
        - { resource: "@SynoliaSyliusSchedulerCommandPlugin/Resources/config/config.yaml" }
  4. Import routing in your config/routes.yaml file:

    synolia_scheduled_command:
        resource: "@SynoliaSyliusSchedulerCommandPlugin/Resources/config/admin_routing.yaml"
        prefix: /admin
  5. Copy plugin migrations to your migrations directory (e.g. src/Migrations) and apply them to your database:

    cp -R vendor/synolia/sylius-scheduler-command-plugin/src/Migrations/* src/Migrations
    bin/console doctrine:migrations:migrate
  6. Launch Run command in your Crontab

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

    composer require sivaschenko/utility-cron
    

Usage

  • Log into admin panel
  • Click on Scheduled commands in the Configuration section in main menu
  • Manage your Scheduled 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 * * *'
                                logFile: 'reset.log'
                                priority: 0
                                enabled: true
                            -
                                name: 'Cancel Unpaid Orders'
                                command: 'sylius:cancel-unpaid-orders'
                                cronExpression: '0 0 * * *'
                                priority: 1
                                enabled: false

Development

See How to contribute.

License

This library is under the MIT license.

Credits

Developed by Synolia.

syliusschedulercommandplugin's People

Contributors

oallain avatar thegrimmchester avatar galloisluca avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.