您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

initBenchmark.sh 608B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env bash
  2. function clearCacheAndLogs() {
  3. rm -rf var/cache/*
  4. [ "$?" != "0" ] && exit 1
  5. chmod -R 777 var/cache
  6. [ "$?" != "0" ] && exit 1
  7. rm -rf var/log/*
  8. [ "$?" != "0" ] && exit 1
  9. chmod -R 777 var/log
  10. [ "$?" != "0" ] && exit 1
  11. }
  12. function initBenchmark() {
  13. # because of Symfony Flex bug (https://github.com/symfony/symfony/issues/29581), we need to remove vendor
  14. rm -rf vendor/
  15. clearCacheAndLogs
  16. composer install --no-dev --classmap-authoritative
  17. [ "$?" != "0" ] && exit 1
  18. clearCacheAndLogs
  19. php bin/console cache:warmup
  20. return 0
  21. }