0

我对教义有问题。我在 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

在我添加这些行之前,一方工作。

问题出在哪里?数据库:登录:root@localhost,我没有密码。请帮忙

4

1 回答 1

1

这一行:

doctrine.yaml_schema_path = "APPLICATION_PATH "/doctrine/schema"

在 APPLICATION_PATH 之前的开头有一个不需要和额外的 "

doctrine.yaml_schema_path = APPLICATION_PATH "/doctrine/schema"

就这样。

于 2012-12-17T17:15:31.897 回答