symfony2.6 doctrine2 schema_filter参数不存在 [英] symfony2.6 doctrine2 schema_filter parameter not exists
问题描述
我正在使用symfony 2.6(composer.json等于其github存储库),并且尝试使用DBAL的模式过滤器。
I am using symfony 2.6 (composer.json equal to its github repo) and I am trying to use the schema filter of DBAL.
在config.yml
in config.yml
# Doctrine Configuration
doctrine:
dbal:
schema_filter: ^sf2_
但在shell上返回错误:
but error returned on shell:
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized option "schema_filter" under "doctrine.dbal"
我想念什么?
编辑:
config.yml(仅适用于教义部分)
config.yml (doctrine part only)
doctrine:
dbal:
default_connection: default
connections:
default:
driver: "%database.driver%"
host: "%database.master.host%"
port: "%database.master.port%"
dbname: "%database.master.dbname%"
user: "%database.master.user%"
password: "%database.master.password%"
charset: UTF8
options:
1002: "SET NAMES '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%"
slaves:
slave1:
host: "%database.slave1.host%"
port: "%database.slave1.port%"
dbname: "%database.slave1.dbname%"
user: "%database.slave1.user%"
password: "%database.slave1.password%"
mapping_types:
enum: string
set: string
bit: boolean
types:
# some types
orm:
auto_generate_proxy_classes: "%kernel.debug%"
default_entity_manager: default
entity_managers:
default:
connection: default
(POST)注意:
无论如何, schema_filter
都不符合我的要求,使用reg exp定义太模糊了(我的意思是,对于我的实际架构而言,需要一个过于复杂的reg exp,一点也不实用)。我在doctrine2组中发布了增强此选项的请求。
https://groups.google.com/forum/# !topic / doctrine-user / Tr4kkpIxwRk
Anyway the schema_filter
does not fit my requirements it is too vague to define with a reg exp (I mean for my actual schema is required a too complex reg exp and it is not pratical at all). I posted in doctrine2 groups a request for "enhancing" this option.
https://groups.google.com/forum/#!topic/doctrine-user/Tr4kkpIxwRk
推荐答案
您确切的symfony版本是什么?我在Symfony 2.6.5中尝试了此配置选项,并且一切正常。
What is your exact symfony version? I tried this config option with Symfony 2.6.5 and everything works fine.
您碰巧有多个连接吗?在页面末尾,文档中对此有一个注释:
Do you happen to have multiple connections? There is a note in documentation about this, at the end of the page:
请注意,如果您配置了多个连接,则schema_filter配置将需要每个连接放置。
这篇关于symfony2.6 doctrine2 schema_filter参数不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!