尝试使用 composer.phar 更新我的供应商时出现以下致命错误:
$ php bin/composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Generating autoload files
Fatal error: Interface 'Metadata\AdvancedMetadataFactoryInterface' not found in /sf2path/vendor/jms/metadata/src/Metadata/MetadataFactory.php on line 26
PHP Fatal error: Interface 'Metadata\AdvancedMetadataFactoryInterface' not found in /sf2path/vendor/jms/metadata/src/Metadata/MetadataFactory.php on line 26
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
昨天我创建了一个全新安装,它可以在我的家用机器上运行。我还为典型的 symfony 目录(app/cache、web、vendor...)添加了一个 .gitignore 文件:
/web/bundles/
/app/bootstrap*
/app/cache/*
/app/logs/*
/vendor/
/app/config/parameters.yml
现在,当从存储库中提取时,我显然错过了供应商,所以我想我只需更新它们,但现在我得到了上述错误。
这是我的composer.json:
"require": {
...
"jms/metadata": "*",
"fpn/doctrine-extensions-taggable": "dev-master",
"fpn/tag-bundle": "dev-master",
"jms/serializer-bundle": "dev-master",
"friendsofsymfony/rest-bundle": "dev-master",
"friendsofsymfony/user-bundle": "*",
"friendsofsymfony/comment-bundle": "*"
},
谷歌并没有真正提供帮助,所以也许这里的任何人都有同样的问题并找到了解决方案。