每当我执行composer.phar install时,它会清除Symfony的dev缓存。
是否有一种方法可以清除其他环境的缓存,比如生产环境?我知道我可以随时运行app/console cache:clear --env=prod。但是在获取依赖项后,我希望Composer能处理这个问题。
是否有一种方法可以清除其他环境的缓存,比如生产环境?我知道我可以随时运行app/console cache:clear --env=prod。但是在获取依赖项后,我希望Composer能处理这个问题。
"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"
],
"post-update-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"
]
}
在查找如何在composer更新后设置资源符号链接选项时,我找到了这个答案。
您可以在composer.json文件的extra节点中添加“symfony-assets-install”条目来执行此操作。
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "symlink"
}
来源:更新供应商