繁体   English   中英

在Symfony2中配置Propel ORM时出错

[英]Errors with configuring Propel ORM in Symfony2

我正在尝试在Symfony2项目中配置propel ORM,但是每次运行symfony command lin工具时,我都会不断收到此错误消息:

[Symfony\Component\Config\Exception\FileLoaderLoadException]
  There is no extension able to load the configuration for "propel" (in C:\Program Files (x86)\Zend\Apache2\htdocs\se\app/config\config.yml). Looked for namespace "propel", found "
  framework", "security", "twig", "monolog", "swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "acme_demo", "debug", "web_profiler", "sensio_distribution" in C:\Progr
  am Files (x86)\Zend\Apache2\htdocs\se\app/config\config.yml (which is being imported from "C:\Program Files (x86)\Zend\Apache2\htdocs\se\app/config/config_dev.yml").

我根据官方文档配置:

#Propel Configuration
propel:
    dbal:
        driver:     "%database_driver%"
        user:       "%database_user%"
        password:   "%database_password%"
        dsn:        "%database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%"

我通过作曲家正确地安装了propel软件包。 propel命令行工作正常。

您是否将PropelBundle添加到AppKernel 好像你没有。

AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Propel\PropelBundle\PropelBundle(),
    );

    // ...
}

http://propelorm.org/Propel/cookbook/symfony2/working-with-symfony2.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM