如果您运行composer run-script reset-bootstrap-cmd命令,您还将更新您的项目依赖关系,这不是此处的所需行为。 如果这样做,则必须测试新更改,以查看它们是否确实以某种方式影响了您的应用程序。
因此,如果您只想重建引导缓存文件,那么我建议您运行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