如果您运行composer update 命令,您还将更新您的项目依赖项,这不是此处所需的行为。如果你这样做了,你将不得不测试新的更改,看看它们是否会以某种方式影响你的应用程序。
因此,如果您只想重建引导缓存文件,那么我建议您运行 post-update-cmd 命令。
因此你应该使用:
composer run-script post-update-cmd
在我的例子中执行以下脚本(参见 composer.json):
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrapSass"
]
}
请考虑您还可以在其中创建一组新脚本来重建引导文件并清除缓存而不安装资产等等:
"scripts": {
"reset-bootstrap-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache"
]
}
然后...composer run-script reset-bootstrap-cmd