HWIOAuthBundle错误不存在的服务“会话”

时间:2015-05-26 22:51:35

标签: symfony hwioauthbundle

我看过每个人,但找不到对此的引用:

配置HWIOAuthBundle并解决了一些问题后,我收到以下错误:

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

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

hwi_oauth:
# name of the firewall in which this bundle is active, this setting MUST be set
firewall_name: secured_area

resource_owners:
    google:
        type:                google
        client_id:           "977681365085-3pb"
        client_secret:       "0IvhJ-DL7"
        scope:               "https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
        #options:
            #access_type:  offline

# Twig Configuration
twig:
debug:            %kernel.debug%
strict_variables: %kernel.debug%
exception_controller: 'FOS\RestBundle\Controller\ExceptionController::showAction'

# Assetic Configuration
assetic:
debug:          %kernel.debug%
use_controller: false
bundles:        [ MagneticsAdminBundle ]
#java: /usr/bin/java
filters:
    cssrewrite: ~
    #closure:
    #    jar: %kernel.root_dir%/Resources/java/compiler.jar
    #yui_css:
    #    jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar

# Doctrine Configuration
doctrine:
dbal:
    driver:   %database_driver%
    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, add the path in parameters.yml
    # e.g. database_path: %kernel.root_dir%/data/data.db3
    # path:     %database_path%

orm:
    auto_generate_proxy_classes: %kernel.debug%
    auto_mapping: true

# Swiftmailer Configuration
swiftmailer:
transport: %mailer_transport%
host:      %mailer_host%
username:  %mailer_user%
password:  %mailer_password%
spool:     { type: memory }

sensio_framework_extra:
view: { annotations: false }

fos_rest:
disable_csrf_role: ROLE_API
param_fetcher_listener: true
view:
    mime_types:
        json: ['application/json', 'application/json;version=1.0', 'application/json;version=1.1']
    view_response_listener: 'force'
    formats:
        xml:  true
        json: true
    templating_formats:
        html: true
format_listener:
    rules:
        - { path: ^/, priorities: [ html, json, xml ], fallback_format: ~, prefer_extension: true }
    media_type:
        version_regex: '/(v|version)=(?P<version>[0-9\.]+)/'
exception:
    codes:
        'Symfony\Component\Routing\Exception\ResourceNotFoundException': 404
        'Doctrine\ORM\OptimisticLockException': HTTP_CONFLICT
    messages:
        'Symfony\Component\Routing\Exception\ResourceNotFoundException': true
allowed_methods_listener: true
access_denied_listener:
    json: true
body_listener: true

fos_http_cache:
cache_control:
    rules:
        # the controls section values are used in a call to Response::setCache();
        -
            match:
                path: ^/notes
                methods: [GET, HEAD]
            headers:
                cache_control: { public: true, max_age: 15, s_maxage: 30 }
                last_modified: "-1 hour"
                vary: [Accept-Encoding, Accept-Language]

我正在使用Symfony 2.6,这是我的配置文件:

in

我发现了类似的问题,但没有一个解决方案对我有用,有人有想法吗?

1 个答案:

答案 0 :(得分:2)

您在配置中禁用了会话

session: false

我肯定不知道这一点,但我猜测会话服务disabled at the framework level时不会创建会话服务。

您可以通过调试容器来检查

$ php app/console container:debug

或更有针对性的

$ php app/console container:debug session