在 Symfony2 中配置 Propel ORM 时出错
Errors with configuring Propel ORM in Symfony2
我正在尝试在 Symfony2 项目中配置 propel ORM,但是当我使用 运行 symfony 命令 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%"
并且我通过 composer 正确安装了 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
我正在尝试在 Symfony2 项目中配置 propel ORM,但是当我使用 运行 symfony 命令 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%"
并且我通过 composer 正确安装了 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