我使用 symfony 标准 2.1
我的 composer.json 文件:
{
"name": "xxx",
"description": "xxx",
"autoload": {
"psr-0": {
"": "src/"
}
},
"minimum-stability": "dev",
"authors": [
{
"name": "xxx",
"email": "xxx"
}
],
"require": {
"php": ">=5.3.2",
"ext-iconv": "*",
"ext-intl": "*",
"igorw/composer-yaml": "dev-master",
"symfony/symfony": "2.1.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.0.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.1.*",
"symfony/monolog-bundle": "2.1.*",
"sensio/distribution-bundle": "2.1.*",
"sensio/framework-extra-bundle": "2.1.*",
"sensio/generator-bundle": "2.1.*",
"jms/security-extra-bundle": "1.2.*",
"jms/di-extra-bundle": "1.1.*",
"propel/propel-bundle": "1.1.*"
},
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"
],
"post-update-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web"
}
}
我在http://www.propelorm.org/cookbook/symfony2/working-with-symfony2.html上安装了推进器
然后我用了命令
php app/console propel:form:generate @AcmeDemoBundle 图书作者
并引发以下异常:
[ErrorException] 可捕获的致命错误:传递给 Propel\PropelBundle\Command\AbstractCommand::getSchemasFromBundle() 的参数 1 必须实现接口 Symfony\Component\HttpKernel\Bundle\BundleInterface,给定 null,在 \vendor\propel\propel-bundle\ 中调用Propel\PropelBundle\Command\FormGenerateCommand.php 在第 55 行并在 \vendor\propel\propel-bundle\Propel\PropelBundle\Command\AbstractCommand.php 第 268 行中定义
我已经尝试过几次(创建新项目并遵循 propel 的安装说明);我还通过安装分支 1.1 的所有标签(一个接一个)来尝试它,但我总是从上面得到 ErrorException。我已经搜索过是否有人有同样的问题,但我没有找到任何人,我也不知道我能做什么。