I have a very simple question. Which magento commands cause the removal of
var/cache/ var/generation/ var/di/
Folders and which bin/magento commands create them again.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
var/cache is cleared by
php bin/magento cache:flush. It rebuilds on the fly as data is cached by Magento (there's no command to rebuild, it just happens).
var/generation are cleared by
php bin/magento setup:upgrade, or manually (like executing
rm -rf var/di var/generation from site root--be very careful with this!). You can rebuild them by running the command
php bin/magento setup:di:compile. If you are in non-production mode, you can leave them and Magento will rebuild the generated sources on the fly (but it'll be a little slower while that happens).