First -
-
Turn on contrib recipie support
- composer config extra.symfony.allow-contrib true
-
Then require the packages
- composer require mmucklo/queue-bundle
-
If you want the admin pages, you'll need to install symfony templating
- composer require symfony/templating
-
Inside of config/packages/framework.yaml, make sure you have the twig templating engine turned on:
- (this also requires the symfony/framework package if you haven't already installed it)
framework:
# ...
templating:
engines: ['twig']
You'll need to update your config/packages/doctrine_mongodb.yaml file
config/packages/doctrine_mongodb.yaml:
doctrine_mongodb:
# ...
document_managers:
default:
# ...
mappings:
# ...
DtcQueueBundle:
dir: Document/
type: annotation
config/packages/dtc_queue.yaml:
dtc_queue:
default_manager: orm
# ...
See the full list of options in /Resources/doc/full-configuration.md
NOTE: You may need to add DtcQueueBundle to your mappings section in config/packages/doctrine.yaml if auto_mapping is not enabled
Finally,
- You'll need to create the schemas in your database by using one of:
- bin/console doctrine:schema:update --dump-sql
- bin/console doctrine:schema:update --force
- Doctrine Migrations (requires DoctrineMigrationsBundle to be installed):
- bin/console doctrine:migrations:diff --filter-expression=/dtc_/
- then:
- bin/console doctrine:migrations:migrate
Additionally, if you choose to record job timings (to display in the /timings display), you'll need to install and configure doctrine extensions that support the YEAR, MONTH, DAY, HOUR functions:
- Bundle #1 [beberlei/doctrineextensions][https://github.com/beberlei/DoctrineExtensions]
- Then add the Date and Time functions as instructed here:
- Bundle #2 oroinc/doctrine-extensions
- Then add the Date and Time functions as instructed here:
- symfony2
- (should work for symfony 3 as well, though labeled symfony2)
- symfony2
- Then add the Date and Time functions as instructed here:
For the Admin pages, add this to your config/routes.yaml file:
config/routes.yaml:
dtc_queue:
resource: '@DtcQueueBundle/Resources/config/routing.yml'
dtc_grid:
resource: '@DtcGridBundle/Resources/config/routing.yml'
Routes:
- /dtc_queue/jobs
- ODM / ORM only
- /dtc_queue/all_jobs
- ODM / ORM list of all jobs
- /dtc_queue/runs
- ODM / ORM only (or another type of queue with an ODM / ORM run_manager)
- /dtc_queue/status
- /dtc_queue/workers
- /dtc_queue/trends
- Graph (requires job_timings: true and an ODM / ORM run_manager)
If you haven't already:
composer require security
In config/packages/security.yaml do the following:
config/packages/security.yaml:
security:
# ...
providers:
# ...
firewall:
# ...
access_control:
# ...
- { path: ^/dtc_queue, roles: ROLE_ADMIN }
- { path: ^/dtc_grid, roles: ROLE_ADMIN }