comment 0
/ wsakaren

Magento 2 Directory Locations

We all have a lot of knowledge of Magento 1.x. When moving to Magento 2 its good if we can use that knowledge rather than just starting from scratch. ┬áHere are a number of things that I’ve found useful.

Ignoring frontend logic the important directories I can see so far are:

  • app/code/Magento – Holds Magento implementation modules, e.g Customer, Cart, Checkout
  • internal/Magento/Framework – Magento Framework e.g. Session Handling, SQL Setup, Cache
  • pub/errors – Can move the local.xml.sample to local.xml so you don’t have to keep looking in report directory!!
  • vendor – 3rd Party libraries loaded via composer
  • app/code/<Vendor> – 3rd Party magento extensions
  • app/etc/env.php – db credentials, replaces local.xml?
  • var/cache, var/generation & var/page_cache – Delete these 3 directories to fully flush cache
  • dev/tests – Unit Tests

To create a module start off by just adding it under app/code/. You can move it to composer later (it should live in vendor/). Yes I know everyone will shout at me for not doing it from Composer first. But its a total pain, until you get more experienced just shortcut it.

Leave a Reply

Your email address will not be published. Required fields are marked *