我对Doctrine有疑问。我在application.ini中添加了这一行:
includePaths.model = APPLICATION_PATH "/models"
autoloaderNamespaces[] = "Doctrine"
doctrine.dns = "mysql://root@localhost/translators"
dectrine.data_fixtures_path = APPLICATION_PATH "/doctrine/data/fixtures"
doctrine.models_path = APPLICATION_PATH "/models"
doctrine.migrations_path = APPLICATION_PATH "/doctrine/migrations"
doctrine.sql_path = APPLICATION_PATH "/doctrine/data/sql"
doctrine.yaml_schema_path = "APPLICATION_PATH "/doctrine/schema"
doctrine.generate_models_options.pearStyle = true
doctrine.generate_models_options.generateTableClasses = true
doctrine.generate_models_options.generateBaseClasses = true
doctrine.generate_models_options.baseClassPrefix = "Base_"
doctrine.generate_models_options.baseClassesDirectory =
doctrine.generate_models_options.classPrefixFiles = false
doctrine.generate_models_options.classPrefix = "Application_Model_"
,这在Bootstrap.php中
public function _initDoctrine()
{
$doctrineConfig = $this->getOption('doctrine');
$manager = Doctrine_Manager::getInstance();
$manager->setAttribute(Doctrine_Core::ATTR_AUTO_ACCESOR_OVERRIDE, true);
$conn = Doctrine_Manager::connection($doctrineConfig['dns'], 'doctrine');
$conn->setAttribute(Doctrine_Core::ATTR_USE_NATIVE_ENUM, true);
return $conn;
}
之后,我方不想工作。它给了我这个错误:
( ! ) Fatal error: Uncaught exception 'Zend_Config_Exception' with message 'syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in C:\projects\translators\library\Zend\Config\Ini.php on line 182
( ! ) Zend_Config_Exception: syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in C:\projects\translators\application/configs/application.ini on line 41 in C:\projects\translators\library\Zend\Config\Ini.php on line 182
Call Stack
# Time Memory Function Location
1 0.0008 329544 {main}( ) ..\index.php:0
2 0.0033 336296 Zend_Application->__construct( ) ..\index.php:24
3 0.0066 350080 Zend_Application->_loadConfig( ) ..\Application.php:85
4 0.0108 376896 Zend_Config_Ini->__construct( ) ..\Application.php:386
5 0.0109 376928 Zend_Config_Ini->_loadIniFile( ) ..\Ini.php:126
6 0.0109 376928 Zend_Config_Ini->_parseIniFile( ) ..\Ini.php:202
在我添加这些线之前,这边工作了。
问题出在哪里? database:login:root @ localhost,我没有密码。请帮忙
答案 0 :(得分:1)
这一行:
doctrine.yaml_schema_path = "APPLICATION_PATH "/doctrine/schema"
在APPLICATION_PATH
之前的开头有一个不需要和额外的“doctrine.yaml_schema_path = APPLICATION_PATH "/doctrine/schema"
多数人。