Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/_includes/php-dev/component-required-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Required files

The following files are required for all components:

* `registration.php`: Among other things, this file specifies the directory in which the component is installed by vendors in production environments. By default, Composer automatically installs components in the `<Magento root dir>/vendor` directory. For more information, see [Component registration]({{ page.baseurl }}/extension-dev-guide/build/component-registration.html).
* `composer.json`: Specifies component dependencies and other metadata. For more information, see [Composer integration]({{ page.baseurl }}/extension-dev-guide/build/composer-integration.html).

Each component has an additional component-specific required file:

| Component Type | Required file | Description |
| --- | --- | --- |
| `magento2-module` | [module.xml]({{page.baseurl}}/architecture/archi_perspectives/components/modules/mod_depend.html#managing-module-dependencies) | This file defines basic information about the component, such as component dependencies and version number. Magento uses the version number to determine which schema and data to update when executing `bin/magento setup:upgrade`. |
| `magento2-theme` | [theme.xml]({{page.baseurl}}/frontend-dev-guide/themes/theme-create.html#fedg_create_theme_how-to_declare) | Describes the Magento theme. File specifies a theme name in the `title` node, a parent theme (optional), and a theme preview image (optional) in the `media/preview_image` node. |
| `magento2-language` | [language.xml]({{page.baseurl}}/config-guide/cli/config-cli-subcommands-i18n.html#m2devgde-xlate-files) | Declares a language translation package. |
10 changes: 1 addition & 9 deletions src/_includes/php-dev/component-root-2.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,4 @@ A component's root directory matches the component's name and contains all its s

* `<Magento install directory>/vendor`: You will find this location for installations that use the [`composer create-project`]({{page.baseurl}}/install-gde/composer.html) to install the Magento 2 metapackage (which downloads the CE or EE code). You will also find this location if you install Magento by extracting the [compressed Magento 2 archive]({{page.baseurl}}/install-gde/prereq/zip_install.html).

Magento installs third-party components in the `vendor` directory. But we recommend adding your components to the `app/code` directory. If you put your component in the `vendor` directory, Git will ignore it because Magento adds the `vendor` directory to the `.gitignore` file.

### Required files

All components require these three files:

* `registration.php`: This file registers your component with Magento. It uses the component's root directory name as the component name. By default, the composer installs components in the `<Magento root dir>/vendor` directory. For more information, see [Component registration]({{page.baseurl}}/extension-dev-guide/build/component-registration.html).
* `etc/module.xml`: This file defines basic information about the component, such as component dependencies and version number. Magento uses the version number to determine which schema and data to update when executing `bin/magento setup:upgrade`.
* `composer.json`: This file defines the dependencies that the component needs at runtime. For more information, see [Composer integration]({{page.baseurl}}/extension-dev-guide/build/composer-integration.html).
Magento installs third-party components in the `<Magento install directory>/vendor` directory. But we recommend adding your components to the `<Magento install directory>/app/code` directory. If you add your component to the `<Magento install directory>/vendor` directory, [Git](https://git-scm.com/docs) will ignore it because Magento adds the `vendor` directory to the `<Magento install directory>/.gitignore` file.
10 changes: 1 addition & 9 deletions src/_includes/php-dev/component-root.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,4 @@ A component's root directory is the top-level directory for that component under

* `<Magento install directory>/vendor`: This location is found in the alternative setups where the {% if page.guide_version == "2.0" %} [`composer create-project`]({{page.baseurl}}/install-gde/prereq/integrator_install.html) {% else %} [`composer create-project`]({{page.baseurl}}/install-gde/composer.html). {% endif %} command was used to get a Magento 2 metapackage (which downloads the CE or EE code), or a [compressed Magento 2 archive]({{ page.baseurl }}/install-gde/prereq/zip_install.html) was extracted in order to install Magento.

Any third party components (and the Magento application itself) are downloaded and stored under the `vendor` directory. If you are using Git to manage project, this directory is typically added to the `.gitignore` file. Therefore, we recommend you do your customization work in `app/code`, not `vendor`.

### Required files

The following files are required for all components:

* `registration.php`: Among other things, this file specifies the directory in which the component is installed by vendors in production environments. By default, composer automatically installs components in the `<Magento root dir>/vendor` directory. For more information, see [Component registration]({{ page.baseurl }}/extension-dev-guide/build/component-registration.html).
* `etc/module.xml`: This file specifies basic information about the component such as the components dependencies and its version number. This version number is used to determine schema and data updates when `bin/magento setup:upgrade` is run.
* `composer.json`: Specifies component dependencies and other metadata. For more information, see [Composer integration]({{ page.baseurl }}/extension-dev-guide/build/composer-integration.html).
Any third-party components (and the Magento application itself) are downloaded and stored under the `<Magento install directory>/vendor` directory. If you are using [Git](https://git-scm.com/docs) to manage your project, this directory is typically added to the `<Magento install directory>/.gitignore` file. Therefore, we recommend you do your customization work in `<Magento install directory>/app/code`, not `<Magento install directory>/vendor`.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ In addition, you can choose the component root directory to start development. T

{% include php-dev/component-root.md %}

{% include php-dev/component-required-files.md %}

{:.ref-header}
Related topic

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ In addition, you can choose the component root directory to start development. T

{% include php-dev/component-root-2.3.md %}

{% include php-dev/component-required-files.md %}

{:.ref-header}
Related topic

Expand Down