backup-manager / symfony

Driver to seamlessly integrate the Backup Manager into Symfony applications.
119 stars 40 forks source link

Could not find configuration for connection local #50

Closed vipankumar87 closed 5 years ago

vipankumar87 commented 6 years ago

xxx

Nyholm commented 6 years ago

Thank you. Could you provide your configuration?

vipankumar87 commented 6 years ago
-- **security.yml**

security:
    encoders:
        AppBundle\Entity\User: bcrypt
    role_hierarchy:
        ROLE_USER:        [ROLE_USER]
        ROLE_ADMIN:       [ROLE_USER, ROLE_ADMIN]
        ROLE_PTADMIN:     [ROLE_PTADMIN, ROLE_ADMIN]
        ROLE_SUPER_ADMIN: [ROLE_SUPER_ADMIN, ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
    providers:
        database_users:
            entity: { class: AppBundle:User, property: email }
    firewalls:
        # disables authentication for assets and the profiler, adapt it according to your needs
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        main:
            switch_user: true
            pattern: ^/
            anonymous: ~
            guard:
                authenticators:
                    - app.form_login_authenticator
            logout:
                path: /logout
                target: /
    access_control:
        - { path: ^/nglngl, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/forgot-password, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/reset, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/ngl/super/, roles: ROLE_ADMIN }
        - { path: ^/ngl/user/, roles: ROLE_USER }
--- **services.yml**
# Learn more about services, parameters and containers at
# https://symfony.com/doc/current/service_container.html
parameters:
    #parameter_name: value
    driver: pdo_mysql
    dbhost: '%database_host%'
    dbport: '%database_port%'
    dbname: '%database_name%'
    dbuser: '%database_user%'
    dbpassword: '%database_password%'
    charset: UTF8
twig:
    globals:
        site_title: '%betting_app_title%'
        SITE_LOGO: '%betting_app_logo%'
        APP_SHORT_NAME: '%app_short_name%'
        date_format: '%date_format%'
        datetime_format: '%datetime_format%'
services:
#    sotb_core.listener.login:
#        class: AppBundle\EventListener\TokenSubscriber
#        scope: "request"
#        tags: 
#            - { name: kernel.event_listener, event: security.interactive_login, method: onSecurityInteractiveLogin}
#        arguments: 
#            - { type: service, id: "router" }
#            - { type: service, id: "security.context"}
#            - { type: service, id: "event_dispatcher"}
#        
    app.form_login_authenticator:
        class: AppBundle\Security\FormLoginAuthenticator
        arguments: ["@router", "@security.password_encoder"]
    # default configuration for services in *this* file
    _defaults:
        # automatically injects dependencies in your services
        autowire: true
        # automatically registers your services as commands, event subscribers, etc.
        autoconfigure: true
        # this means you cannot fetch services directly from the container via $container->get()
        # if you need to do this, you can override this setting on individual services
        public: false

    # makes classes in src/AppBundle available to be used as services
    # this creates a service per class whose id is the fully-qualified class name
    AppBundle\:
        resource: '../../src/AppBundle/*'
        # you can exclude directories or files
        # but if a service is unused, it's removed anyway
        exclude: '../../src/AppBundle/{Entity,Repository,Tests}'

    # controllers are imported separately to make sure they're public
    # and have a tag that allows actions to type-hint services
    AppBundle\Controller\:
        resource: '../../src/AppBundle/Controller'
        public: true
        tags: ['controller.service_arguments']

    # add more services, or override services that need manual wiring
    # AppBundle\Service\ExampleService:
    #     arguments:
    #         $someArgument: 'some_value'
    app.listener.login:
        class: AppBundle\Listener\LoginListener
        arguments: ['@router', '@security.token_storage', '@event_dispatcher', '@logger']
        scope: request
        tags:
            - { name: kernel.event_listener, event: security.interactive_login, method: onSecurityInteractiveLogin }
    twig_array_filter_function:
        class: AppBundle\Twig\ArrayFilterFunction
        tags:
            - { name: twig.function }
-- ** config.yml **

imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: services.yml }

# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
    locale: en
    photos_directory: '%kernel.root_dir%/../public_html/uploads/photos'
    pins_directory: '%kernel.root_dir%/../public_html/uploads/pins'
framework:
    #esi: ~
    #translator: { fallbacks: ['%locale%'] }
    ide: 'phpstorm://open?url=file://%%f&line=%%l'
    secret: '%secret%'
    router:
        resource: '%kernel.project_dir%/app/config/routing.yml'
        strict_requirements: ~
    form: ~
    csrf_protection: ~
    validation: { enable_annotations: true }
    #serializer: { enable_annotations: true }
    default_locale: '%locale%'
    trusted_hosts: ~
    session:
        # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id
        handler_id: session.handler.native_file
        save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
    fragments: ~
    http_method_override: true
    assets: ~
    php_errors:
        log: true

# Twig Configuration
twig:
    debug: '%kernel.debug%'
    strict_variables: '%kernel.debug%'

# Doctrine Configuration
doctrine:
    dbal:
        driver: pdo_mysql
        host: '%database_host%'
        port: '%database_port%'
        dbname: '%database_name%'
        user: '%database_user%'
        password: '%database_password%'
        charset: UTF8
        # if using pdo_sqlite as your database driver:
        #   1. add the path in parameters.yml
        #     e.g. database_path: '%kernel.project_dir%/var/data/data.sqlite'
        #   2. Uncomment database_path in parameters.yml.dist
        #   3. Uncomment next line:
        #path: '%database_path%'

    orm:
        auto_generate_proxy_classes: '%kernel.debug%'
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true

# Swiftmailer Configuration
swiftmailer:
    transport: '%mailer_transport%'
    host: '%mailer_host%'
    username: '%mailer_user%'
    password: '%mailer_password%'
    spool: { type: memory }
vipankumar87 commented 6 years ago

If you are expecting other thing then Please update me with filename

vipankumar87 commented 6 years ago

I have debug files and i found no configurations are pass to BackupManager\Config\Config::$config this is empty i think BM\BackupManagerBundle\DependencyInjection\Configuration ::getConfigTreeBuilder() this function should be execute to load config but its not executing

Nyholm commented 6 years ago

Did you follow the installation instructions? Im really just interested in how you configured this bundle. =)

See https://github.com/backup-manager/symfony#step-3-configure-your-databases-and-filesystems

vipankumar87 commented 6 years ago

yes i follow these steps

Nyholm commented 6 years ago

Can you show me your config for this bundle?

vipankumar87 commented 6 years ago

I have copied same yml from this page

See https://github.com/backup-manager/symfony#step-3-configure-your-databases-and-filesystems

just changed credentials

Nyholm commented 6 years ago

Could you please show me. (not your credentials of course)

raupie commented 5 years ago

Running into the same issue. I created a file 'app/config/packages/bm_backup_manager.yml' and added the necessary values. Step #2 (with flex) makes it sound like there's some default config and I can't find where that would be so the instructions are confusing.

raupie commented 5 years ago

Figured it out. Moved my config into my config.yml file. If you are using the bm_backup_manager.yml file I assume you will have to include it into your symfony config.yml so it can be read.