Skip to content

Commit

Permalink
feat: switch to dev env by default+web profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
COil committed Oct 5, 2023
1 parent 79b346e commit 57869f6
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 7 deletions.
13 changes: 11 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=prod
APP_SECRET=155f2a3ce20caf4c940aad5a3aa29410
APP_ENV=dev
APP_DEBUG=1
APP_SECRET=3bUhVCRkHJfT2ZJTqBnvkclRFT1zy1ig
###< symfony/framework-bundle ###

# To test the production environmet, run:
# > cp .env.local.dist .env.local
# > bin/console asset-map:compile

# To come back to the development environment, run:
# > rm .env.local
# > rm -rf ./public/assets/*
2 changes: 2 additions & 0 deletions .env.local.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
APP_ENV=prod
APP_DEBUG=0
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@ deploy: ## Simple manual deploy on VPS (this is to update the demo site https://
@git pull
@composer install
@chown -R www-data: var/*
@cp .env.local.dist .env.local
@bin/console asset-map:compile
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,13 @@ Because a live demo is always better than all explanations. Here is it:

## What it doesn't ship? ❌

* The debug toolbar ([installation](https://symfony.com/doc/current/profiler.html))
* Doctrine ([installation](https://symfony.com/doc/current/doctrine.html#installing-doctrine))


## References 📚

* [Castor, a journey across the sea of task runners](https://jolicode.com/blog/castor-a-journey-across-the-sea-of-task-runners)
* [Initializing your Symfony project with solid foundations](https://www.strangebuzz.com/en/blog/initializing-your-symfony-project-with-solid-foundations)
* [Organizing your Symfony project tests](https://www.strangebuzz.com/en/blog/organizing-your-symfony-project-tests)
* [What are your Symfony best practices?](https://www.strangebuzz.com/en/blog/what-are-your-symfony-best-practices)
* [Setting a CI/CD workflow for a Symfony project thanks to the GitHub actions ](https://www.strangebuzz.com/en/blog/setting-a-ci-cd-workflow-for-a-symfony-project-thanks-to-the-github-actions)
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
"roave/security-advisories": "dev-latest",
"symfony/browser-kit": "~6.3.0",
"symfony/css-selector": "~6.3.0",
"symfony/phpunit-bridge": "^6.3"
"symfony/phpunit-bridge": "^6.3",
"symfony/stopwatch": "6.3.*",
"symfony/web-profiler-bundle": "6.3.*"
},
"replace": {
"symfony/polyfill-ctype": "*",
Expand Down Expand Up @@ -101,8 +103,7 @@
],
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"asset-map:compile": "symfony-cmd"
"assets:install %PUBLIC_DIR%": "symfony-cmd"
}
},
"scripts-descriptions": {
Expand Down
83 changes: 82 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
];
17 changes: 17 additions & 0 deletions config/packages/web_profiler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
when@dev:
web_profiler:
toolbar: true
intercept_redirects: false

framework:
profiler:
only_exceptions: false
collect_serializer_data: true

when@test:
web_profiler:
toolbar: false
intercept_redirects: false

framework:
profiler: { collect: false }
8 changes: 8 additions & 0 deletions config/routes/web_profiler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
when@dev:
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt

web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler
13 changes: 13 additions & 0 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,19 @@
"config/packages/validator.yaml"
]
},
"symfony/web-profiler-bundle": {
"version": "6.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.1",
"ref": "e42b3f0177df239add25373083a564e5ead4e13a"
},
"files": [
"config/packages/web_profiler.yaml",
"config/routes/web_profiler.yaml"
]
},
"twig/extra-bundle": {
"version": "v3.5.1"
}
Expand Down

0 comments on commit 57869f6

Please sign in to comment.