Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. ifndef APP_ENV
  2. include .env
  3. endif
  4. ###> symfony/framework-bundle ###
  5. cache-clear:
  6. @test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*
  7. .PHONY: cache-clear
  8. cache-warmup: cache-clear
  9. @test -f bin/console && bin/console cache:warmup || echo "cannot warmup the cache (needs symfony/console)"
  10. .PHONY: cache-warmup
  11. CONSOLE=bin/console
  12. sf_console:
  13. @test -f $(CONSOLE) || printf "Run \033[32mcomposer require cli\033[39m to install the Symfony console.\n"
  14. @exit
  15. serve_as_sf: sf_console
  16. @test -f $(CONSOLE) && $(CONSOLE)|grep server:start > /dev/null || ${MAKE} serve_as_php
  17. @$(CONSOLE) server:start --docroot=public/ || exit 1
  18. @printf "Quit the server with \033[32;49mbin/console server:stop.\033[39m\n"
  19. serve_as_php:
  20. @printf "\033[32;49mServer listening on http://127.0.0.1:8000\033[39m\n";
  21. @printf "Quit the server with CTRL-C.\n"
  22. @printf "Run \033[32mcomposer require symfony/web-server-bundle\033[39m for a better web server\n"
  23. php -S 127.0.0.1:8000 -t public
  24. serve:
  25. @${MAKE} serve_as_sf
  26. .PHONY: sf_console serve serve_as_sf serve_as_php
  27. ###< symfony/framework-bundle ###