config.yml 9.03 KB
imports:
    - { resource: parameters.yml }
    - { resource: security.yml }

framework:
    #esi:             ~
    translator:      { fallback: en }
    secret:          "%secret%"
    router:
        resource: "%kernel.root_dir%/config/routing.yml"
        strict_requirements: "%kernel.debug%"
    form:            true
    csrf_protection: true
    validation:      { enable_annotations: true }
    templating:      { engines: ['twig'] } #assets_version: SomeVersionScheme
    default_locale:  "%locale%"
    session: ~
#    trusted_proxies: ~
#    session:
#        handler_id: session.handler.pdo

parameters:
    pdo.db_options:
        db_table:    session
        db_id_col:   session_id
        db_data_col: session_value
        db_time_col: session_time


# Twig Configuration
twig:
    debug:            "%kernel.debug%"
    strict_variables: "%kernel.debug%"
    globals:
        cacic_version: 3.0.0
    form:
        resources:
            - "BraincraftedBootstrapBundle:Form:bootstrap.html.twig"

braincrafted_bootstrap:
    auto_configure:
        assetic: false
        twig: true
        knp_menu: true
        knp_paginator: true


# Assetic Configuration
assetic:
    debug:          "%kernel.debug%"
    use_controller: false
    bundles:        [ CacicCommonBundle, CacicRelatorioBundle, FMElfinderBundle, CocarBundle ]
    java: /usr/bin/java
    filters:
        #closure:
        #    jar: %kernel.root_dir%/Resources/java/compiler.jar
        #yui_css:
        #    jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar
        cssembed:
            jar: "%kernel.root_dir%/Resources/java/cssembed-0.4.5.jar"
        yui_js:
            jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.2.jar"
        yui_css:
            jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.2.jar"
        lessphp:
            file: "%kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php"
            apply_to: "\.less$"
        less:
            node: /usr/local/bin/node
            node_paths: [/usr/local/lib/node_modules/]
            apply_to: "\.less$"
        cssrewrite: ~
    assets:
        bootstrap_css:
            inputs:
                - %kernel.root_dir%/../vendor/twbs/bootstrap/less/bootstrap.less
                - %kernel.root_dir%/../vendor/braincrafted/bootstrap-bundle/Braincrafted/Bundle/BootstrapBundle/Resources/less/form.less
            filters:
                - less
                - cssrewrite
            output: css/bootstrap.css
        bootstrap_js:
            inputs:
                - %kernel.root_dir%/../vendor/twbs/bootstrap/js/transition.js
                - %kernel.root_dir%/../vendor/twbs/bootstrap/js/alert.js
                - %kernel.root_dir%/../vendor/twbs/bootstrap/js/button.js
                - %kernel.root_dir%/../vendor/twbs/bootstrap/js/carousel.js
                - %kernel.root_dir%/../vendor/twbs/bootstrap/js/collapse.js
                - %kernel.root_dir%/../vendor/twbs/bootstrap/js/dropdown.js
                - %kernel.root_dir%/../vendor/twbs/bootstrap/js/modal.js
                - %kernel.root_dir%/../vendor/twbs/bootstrap/js/tooltip.js
                - %kernel.root_dir%/../vendor/twbs/bootstrap/js/popover.js
                - %kernel.root_dir%/../vendor/twbs/bootstrap/js/scrollspy.js
                - %kernel.root_dir%/../vendor/twbs/bootstrap/js/tab.js
                - %kernel.root_dir%/../vendor/twbs/bootstrap/js/affix.js
                - %kernel.root_dir%/../vendor/braincrafted/bootstrap-bundle/Braincrafted/Bundle/BootstrapBundle/Resources/js/bc-bootstrap-collection.js
            output: js/bootstrap.js
        jquery_js:
            inputs:
                - "%kernel.root_dir%/../vendor/jquery/jquery/jquery-1.10.2.js"
            output: js/jquery.js
            filters: [?yui_js]
        bootstrap_less:
            inputs:
                - '%kernel.root_dir%/../vendor/twbs/bootstrap/less/bootstrap.less'
            filters: [less,cssembed]

# Doctrine Configuration
doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                driver:   "%database_driver%"
                host:     "%database_host%"
                port:     "%database_port%"
                dbname:   "%database_name%"
                user:     "%database_user%"
                password: "%database_password%"
                charset:  UTF8
                options:
                    PDO::ATTR_PERSISTENT: true

    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        auto_mapping: true
        dql:
            string_functions:
                string_agg: Cacic\CommonBundle\Query\PostgreSQL\StringAggFunction

# Swiftmailer Configuration
swiftmailer:
    transport: "%mailer_transport%"
    host:      "%mailer_host%"
    username:  "%mailer_user%"
    password:  "%mailer_password%"
    spool:
      type: file
      path: "%kernel.root_dir%/spool"


# KNP Paginator Configuration
knp_paginator:
    page_range: 5                      # default page range used in pagination control
    default_options:
        page_name: page                # page query parameter name
        sort_field_name: sort          # sort field query parameter name
        sort_direction_name: direction # sort direction query parameter name
        distinct: true                 # ensure distinct results, useful when ORM queries are using GROUP BY statements
    template:
        pagination: KnpPaginatorBundle:Pagination:sliding.html.twig     # sliding pagination controls template
        sortable: KnpPaginatorBundle:Pagination:sortable_link.html.twig # sort link template

# Configuration for FMElFinderBundle
fm_elfinder:
    instances:
        default:
            locale: %locale% # defaults to current request locale
            editor: simple # other choices are tinymce or simple, and form
            compression: false # enable if you configured the uglifycss and uglifyjs2 assetic filters and want compression
            connector:
                roots:       # at least one root must be defined
                    uploads:
                        showhidden: false # defaults to false
                        driver: LocalFileSystem
                        path: downloads
                        upload_max_size: 2M
                        upload_deny: ['all']
        form:
            locale: %locale% # defaults to current request locale
            editor: form # other choices are tinymce or simple, and form
            compression: false # enable if you configured the uglifycss and uglifyjs2 assetic filters and want compression
            connector:
                roots:       # at least one root must be defined
                    cacic:
                        showhidden: false # defaults to false
                        driver: LocalFileSystem
                        path: downloads/cacic
                        upload_deny: ['all']
                    outros:
                        showhidden: false # defaults to false
                        driver: LocalFileSystem
                        path: downloads/outros
                        upload_deny: ['all']

jms_translation:
    configs:
        app:
            dirs: [%kernel.root_dir%, %kernel.root_dir%/../app]
            output_dir: %kernel.root_dir%/Resources/translations
            ignored_domains: [routes]
            excluded_names: ["*TestCase.php", "*Test.php"]
            excluded_dirs: [cache, data, logs]
            #extractors: [alias_of_the_extractor]
        src:
            dirs: [%kernel.root_dir%, %kernel.root_dir%/../src]
            output_dir: %kernel.root_dir%/../src/Cacic/CommonBundle/Resources/translations
            ignored_domains: [routes]
            excluded_names: ["*TestCase.php", "*Test.php"]
            excluded_dirs: [Common, Entity, Form]
            #extractors: [alias_of_the_extractor]

doctrine_migrations:
    dir_name: %kernel.root_dir%/../src/Cacic/CommonBundle/DoctrineMigrations
    namespace: Cacic\CommonBundle\Migrations
    table_name: migration_versions
    name: Cacic Migrations

services:
    twig.text_extension:
        class: Twig_Extensions_Extension_Text
        tags:
            - name: twig.extension
    elfinder.driver.filesystem:
        class: FM\ElFinderPHP\Driver\ElFinderVolumeLocalFileSystem
    cacic_demo.command.demo_command:
            class: Cacic\CommonBundle\Command\DemoCommand
            tags:
                -  { name: console.command }
    cacic_demo.command.upgrade_command:
                class: Cacic\CommonBundle\Command\UpgradeCommand
                tags:
                    -  { name: console.command }
    pdo:
        class: PDO
        arguments:
            - "pgsql:host=%database_host%;dbname=%database_name%"
            - "%database_user%"
            - "%database_password%"
        calls:
            - [setAttribute, [3, 2]] # \PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION

    session.handler.pdo:
        class:     Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler
        arguments: ["@pdo", "%pdo.db_options%"]

    apikey_authenticator:
        class:     Cacic\WSBundle\Security\ApiKeyAuthenticator
        arguments: ["@webservice_user_provider"]