Note: Magento 2 development environment in general

  1. Install nginx,php-fpm and composer, nodejs
  2. all projects go in /var/www directory
  3. nginx conf file name for domain names used on local should have pattern example.to.conf
  4. https://www.npmjs.com/package/maildev Setup maildev for local email testing.
  5. bashrc contains code to show me current git branch I’m working on
  6. Install and setup xdebug, easy with php storm
  7. Install Magento 2 phpstrom plugin by going to settings->plugins. Enable Magento support and if required enable MFTF support.
  8. Always keep magento 2 on developer mode
  9. php memory limit to be 1GB
  10. Install Postman for api related work. (Learn it, super useful)
  11. percona-server with 50% ram allowed to innodb_buffer_pool_size
  12. Have a laptop with SSD, I bought one from western digital NVMe.
  13. In my IDE, configure running tests with phpunit
  14. ALT+C copies path from repository root
  15. ALT+SHIFT+C copies fully classified class names. This is frequently done.
  16. CTRL + O to jump to class and CTRL+SHIFT+O jumps to file
  17. CTRL + G jumps to a line and CTRL + ALT + L formats code
  18. Use vim. Be familiar with awk,sed commands
  19. Install strace and bcc, ebpf tools for performance exploration
  20. For all my ssh IPs I maintain an alias in /etc/hosts. So that I can always do abhi@staging1.ssh abhi@staging2.ssh
sudo apt-get install autokey-gtk
php -r '$a = include("app/etc/env.php");extract($a["db"]["connection"]["default"]); echo "mysql -h {$host} -u $username --password=$password  $dbname ".PHP_EOL;'

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store