setono/sylius-scheduler-plugin

Scheduler plugin for Sylius.

Installs: 5 276

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 0

Open Issues: 1

Type:sylius-plugin


README

Latest Version on Packagist Software License Build Status Quality Score

Sylius plugin to schedule jobs at admin panel and track their status.

Admin screenshot

Installation

  • Install plugin using composer:

    $ composer require setono/sylius-scheduler-plugin
  • Add bundle to config/bundles.php before (!) SyliusResourceBundle:

    <?php
    // config/bundles.php
    
    return [
        // ...
        Setono\SyliusSchedulerPlugin\SetonoSyliusSchedulerPlugin::class => ['all' => true],
        Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
    ];
  • Import config:

    # config/packages/_sylius.yaml
    imports:
        # ...
        - { resource: "@SetonoSyliusSchedulerPlugin/Resources/config/app/config.yaml" }
  • Import routes:

    # config/routes.yaml
    setono_sylius_scheduler_admin:
        resource: "@SetonoSyliusSchedulerPlugin/Resources/config/admin_routing.yaml"
        prefix: /admin
  • Update your schema (for existing project):

    # Generate and edit migration
    bin/console doctrine:migrations:diff
    
    # Then apply migration
    bin/console doctrine:migrations:migrate

Plugin configuration

setono_sylius_scheduler:
    driver: doctrine/orm

    # Wipe logs in X days after command execution
    # Specify 0 to never wipe logs
    wipe_logs_in: 0

    # We can specify emails to receive error reports on every Job
    # But here we can specify emails which receive error reports for all Jobs
    error_report_emails: []

Contribution

Installation

To automatically execute installation steps, load fixtures and run server with just one command, run:

# Optional step, if 5 mins enough for webserver to try
# @see https://getcomposer.org/doc/06-config.md#process-timeout
composer config --global process-timeout 0

composer try

or follow next steps manually:

  • Initialize:

    SYMFONY_ENV=test
    (cd tests/Application && yarn install) && \
        (cd tests/Application && yarn build) && \
        (cd tests/Application && bin/console assets:install public -e $SYMFONY_ENV) && \
        (cd tests/Application && bin/console doctrine:database:create -e $SYMFONY_ENV) && \
        (cd tests/Application && bin/console doctrine:schema:create -e $SYMFONY_ENV)
  • If you want to manually play with plugin test app, run:

    SYMFONY_ENV=test
    (cd tests/Application && bin/console sylius:fixtures:load --no-interaction -e $SYMFONY_ENV && \
        (cd tests/Application && bin/console server:run -d public -e $SYMFONY_ENV)

Running plugin tests

  • PHPSpec

    $ composer phpspec
  • Behat

    $ composer behat
  • All tests (phpspec & behat)

    $ composer test

Pushing changes & making PRs

Please run composer all to run all checks and tests before making PR or pushing changes to repo.