Directory Structure in magento 2
Magento 2 directory structure are pretty much self explained only by it's name. If you are inside root of your magento project then you would see following directory...
/app /bin /dev /generated /lib /pub /var /vendor
/app
In this folder, you will find following subfolders:
/code
It includes the Magento 2 core code (One of the locations where you can develop your custom Magento 2 code (custom modules). In some cases, you might not find the core code here. In this case, it’s placed in /vendor/magento directory.
/design
This directory has /adminhtml and /frontend sub-directories which contain theme directories having
phtml, xml, JS
and LESS
files./etc
This directory contains the
di.xml
and env.php
configuration file, the di.xml file contains class mapping and interface preferences. The env.php file contains the configuration details of your Magento 2. It also contains config.php
which contains the list of modules, enabled as well as disabled ones./bin
This directory contains the Magento 2 file or a CLI script;
This CLI script is used to run commands like: enable/disable cache; enable/disable modules; run an indexer, upgrade, deploy etc.
This CLI script is used to run commands like: enable/disable cache; enable/disable modules; run an indexer, upgrade, deploy etc.
/dev
In this directory, Magento 2 tools for development and its test scripts are placed.
When you make a new theme and want to execute LESS files for that theme, after installing grunt you have to go to
When you make a new theme and want to execute LESS files for that theme, after installing grunt you have to go to
/dev/tools/grunt/configs/themes.js
and define your theme with the previously defined themes./lib
This directory contains Magento 2 libraries packed separately from Magento 2 core files.
there are two sub-directories /internal and /web
In /internal subdirectory there are server-side libraries and several font files.
In /web subdirectory there are
there are two sub-directories /internal and /web
In /internal subdirectory there are server-side libraries and several font files.
In /web subdirectory there are
client-side (JavaScript) libraries, jquery, modernizr, requirejs, prototype, scriptaculous
./pub
In this directory, you have the currently running code after the execution of all commands (upgrade/deploy). If you want to make changes and don’t want to run the commands (upgrade/deploy) again and again, you can change the code in /pub directory and can see the changes on the frontend.
/var
In this directory, you have all the cache of your Magento 2, like
(In Magento 2.2.x and later versions, the directory var/generation was removed to the project root and renamed to generated.)
cache, composer_home, generation, log, di, view_preprocessed, page_cache
.(In Magento 2.2.x and later versions, the directory var/generation was removed to the project root and renamed to generated.)
/vendor
This directory is generated by composer using
It includes the packages that have been defined under composer.json.
composer.json
file.It includes the packages that have been defined under composer.json.
Comments
Post a Comment