Skip to content

Install

chris edited this page Mar 22, 2021 · 3 revisions

Installation

With Symfony Flex

Allow Flex to use contrib recipes and require the bundle :

$ composer config extra.symfony.allow-contrib true
$ composer require dukecity/command-scheduler-bundle

The recipe will enable the bundle and its routes, so you can go directly to the configuration section

Without Symfony Flex

1 - Install the bundle

Add the bundle and dependencies in your composer.json :

$ composer require dukecity/command-scheduler-bundle

If you don't have composer yet, please refer to the official Composer website.

Note : use the last release, dev-master is not stable

Enable the bundle in the kernel (schuld be handled for you by symfony):

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Dukecity\CommandSchedulerBundle\DukecityCommandSchedulerBundle(),
    );
}

Now, you have to register the routes provided by the bundle :

# app/config/routing.yml

dukecity_command_scheduler:
    resource: "@DukecityCommandSchedulerBundle/Resources/config/routing.php"
    prefix:   /

2 - Set up configuration

If you do not have auto_mapping set to true or you are using multiple entity managers, then set the bundle in the proper entity manager:

# app/config/config.yml
doctrine:
    orm:
        entity_managers:
            default:
                mappings:
                    YourBundle: ~
                    DukecityCommandSchedulerBundle: ~

If you wish to use default texts provided in this bundle, you have to make sure you have translator enabled in your config.

# app/config/config.yml

framework:
    translator: ~

For more information about translations, check Symfony documentation.

Install bundle's assets :

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

3 - Update the database

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

In case you're using another doctrine manager

$ php bin/console doctrine:schema:update --em=[manager_name] --force

Now, you can use the bundle and manage your scheduling here : http:https://{your-app-root}/command-scheduler/list and execute them with this new command

$ php bin/console scheduler:execute

See the Usage section to have more information

Clone this wiki locally