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

init_benchmark.sh 538B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env bash
  2. function clearCacheAndLogs() {
  3. sudo /bin/rm -rf var/cache/*
  4. [ "$?" != "0" ] && exit 1
  5. sudo /bin/chmod -R 777 var/cache
  6. [ "$?" != "0" ] && exit 1
  7. sudo /bin/rm -rf var/log/*
  8. [ "$?" != "0" ] && exit 1
  9. sudo /bin/chmod -R 777 var/log
  10. [ "$?" != "0" ] && exit 1
  11. php bin/console cache:warmup
  12. }
  13. function init() {
  14. export APP_ENV='prod'
  15. clearCacheAndLogs
  16. composer install --no-dev --classmap-authoritative
  17. [ "$?" != "0" ] && exit 1
  18. clearCacheAndLogs
  19. return 0
  20. }