【问题标题】:Errors with configuring Propel ORM in Symfony2在 Symfony2 中配置 Propel ORM 时出错
【发布时间】:2015-01-23 16:50:19
【问题描述】:

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

[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 命令行工作正常。

【问题讨论】:

    标签: php symfony orm propel


    【解决方案1】:

    您是否将PropelBundle 添加到AppKernel?看起来你没有。

    AppKernel.php

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

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

    【讨论】:

    • 不,我没有,我不知道怎么做?文档中没有提到它。 vendor 目录下的 propel 包没有任何名为 Bundle 的文件夹。
    • 可能你只安装了Propel,没有安装PropelBundle。跟着这个:propelorm.org/Propel/cookbook/symfony2/…
    • 对,我需要安装 PropelBundle 到吗?如果是,来自哪里?
    • 是的,你需要。您可以使用 composer 安装它:packagist.org/packages/propel/propel-bundle
    猜你喜欢
    • 2014-08-15
    • 2023-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-20
    • 2014-04-02
    • 2012-01-29
    • 1970-01-01
    相关资源
    最近更新 更多