Skip to content

Latest commit

 

History

History
112 lines (93 loc) · 3.03 KB

symfony2-3.md

File metadata and controls

112 lines (93 loc) · 3.03 KB

Symfony 2 / 3 Installation Instructions

Then add the bundle to AppKernel.php:

<?php

//...

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
                    //...
                    new \Dtc\GridBundle\DtcGridBundle(),
                    new \Dtc\QueueBundle\DtcQueueBundle(),
// ...

MongoDB Setup:

  • Add MongoDB ODM setting for Job Document.

app/config/config.yml:

doctrine_mongodb:
    document_managers:
        default:
            mappings:
                DtcQueueBundle:
                    dir: Document/
                    type: annotation

ORM Setup:

app/config/config.yml:

dtc_queue:
    manager:
       job: orm

NOTE: You may need to add DtcQueueBundle to your mappings section in config.yml if auto_mapping is not enabled

app/config/config.yml:

doctrine:
   #...
   orm:
       #...
       mappings:
           DtcQueueBundle: ~
  • 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:

Optional Admin

Add this to your app/config/routing.yml file:

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/trends
    • Graph (requires job_timings: true and an ODM / ORM run_manager)

Securing the Admin section

In app/config/security.yml do the following:

app/config/security.yml:

security:
    # ...
    providers:
        # ...
    firewall:
        # ...
    access_control:
        # ...
        - { path: ^/dtc_queue, roles: ROLE_ADMIN }
        - { path: ^/dtc_grid, roles: ROLE_ADMIN }