16

I have downloaded Magento 2 stable from https://www.magentocommerce.com/download with sample data and installed.

It's working fine in both areas i.e. frontend & backend.

But I could not find app/code folder.

Similar module folders are found under vendor\magento.

  • Has the folder structure changed in Magento 2 again?
  • Where we can put our custom module folder?
  • Just remember this, even though Magento 2 has been released into the wild as "stable", it's basically alpha code and may change yet again. Several early adopter mainline module writers have commented on the need to switch horses in midstream about every 3 weeks. You've got about 2 more subversion changes before you can depend on it. – Fiasco Labs Nov 20 '15 at 17:28
  • 1
    Given some feedback, and based on some work by us & the community, we've now moved Magento core code into vendor (where - many would argue - it belongs). – benmarks Nov 30 '15 at 12:21
17

app/code is missing because all Magento modules are put to vendor directory for 3rd-party developers convenience, so they do not have to mix their own code with the core. Now it is easy to develop custom modules without committing the whole Magento core to your GIT repository (unlike in Magento 1).

7

You should not put your custom module folder anywhere by yourself: Composer do it for you and by default it places the packages (and Magento modules among them) to the vendor folder.

  • #Mage2.PRO so i put my custom module in app/code folder or in vendor folder? – Shaheer Ali Nov 18 '15 at 8:10
  • You should put your module into a composer repository. The Composer will download and install your module into a proper folder. Here is an example of my custom composer repository: mage2.pro/packages.json – Mage2.PRO Nov 18 '15 at 8:29
  • if i developed a module locally for m2 then now how can i install it on the m2 stable? – Shaheer Ali Nov 18 '15 at 9:12
  • Put your module into a composer repository: getcomposer.org/doc/05-repositories.md – Mage2.PRO Nov 18 '15 at 9:20
  • 4
    @Mage2.PRO : what should be the exact step by step process to run our module developed in Magento2 Beta? – Chiragit007 Nov 18 '15 at 9:24
1

Actually the only thing you need in a Magento 2 setup is a composer.json file which requires the package magento/product-community-edition from the Composer repository https://repo.magento.com/.

Now when you run composer install it will download a lot of Magento packages and third party packages (Composer, Symfony, Zend, etc...) and place them into the vendor/ folder. Thanks to the Magento Composer Installer it will also copy a lot of Magento 2 files into the root. But actually all your code comes from vendor/.

Now, the app/code folder isn't there by default. You can create it yourself and add your local modules there in this structure: app/code/<VendorName>/<ModuleName>.

You could also develop your modules in a separate VCS (i.e. GIT) repository somewhere and add them to your composer.json which will make them also being installed into the vendor/ directory.

0
  • media and errors folder are moved to pub folder
  • skin and js folder are moved to pub/static folder.

Now it is easy to maintain static content via CDN.

  • js, css, images are again divided into pub/static/adminhtml and pub/static/frontend for backend and frontend area respectively.

  • dev folder contains various tools for developers such as migration tools and tests. shell is moved to dev folder

  • downloader, includes and pkginfo folder are no more with magento 2.

  • setup directory is for installation process

  • get.php, cron.php and index.php files are moved to pub folder.

  • Database connection settings, backend name, session save settings and cache settings are declared in app/etc/env.php

  • Themes are grouped by ‘vendor’ which we known as ‘package’ in magento 1.x. Theme structure in Magento 2 is like app/design/frontend/vendor_name/theme_name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.