我决定在 Zend 中采用这种目录结构:
application
doctrine
models
base
schema
//other Doctrine directories
controllers
models
services
views
我已将其设置为 Doctrine_Cli 的配置选项:
doctrine.cli_options.models_path = APPLICATION_PATH "/doctrine/models/"
doctrine.cli_options.data_fixtures_path = APPLICATION_PATH "/doctrine/data/fixtures"
doctrine.cli_options.sql_path = APPLICATION_PATH "/doctrine/data/sql"
doctrine.cli_options.yaml_schema_path = APPLICATION_PATH "/doctrine/schema"
doctrine.cli_options.migrations_path = APPLICATION_PATH "/doctrine/migrations"
doctrine.cli_options.generate_models_options.generateTableClasses = true
doctrine.cli_options.generate_models_options.generateBaseClasses = true
doctrine.cli_options.generate_models_options.pearStyle = true
doctrine.cli_options.generate_models_options.baseClassPrefix = 'Base_'
doctrine.cli_options.generate_models_options.baseClassName = 'Doctrine_Record'
doctrine.cli_options.generate_models_options.baseClassesDirectory = ''
doctrine.cli_options.generate_models_options.classrefixFiles = false
doctrine.cli_options.generate_models_options.classPrefix = 'Application_Doctrine_Model_'
我还在 Application 命名空间中添加了一个资源来加载Application_Doctrine_Model_*
文件application/doctrine/models
我的问题是,虽然生成的模型是使用预期的前缀创建的,但它们是application/doctrine/models/base
在它们自己的Application/ ..
子目录下的目录下生成的。
结果是application/doctrine/models/Application/Doctrine/Models/...
,因此 Zend 的资源自动加载器找不到它们。
是否有一个配置选项Doctrine_Cli
可以指定我想在下生成模型application/doctrine/models
但不生成新的Application/ ..
PEAR 样式子目录?