Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit c799174

Browse files
Magento CICDMagento CICD
Magento CICD
authored and
Magento CICD
committed
Merge branch 'develop' of github.corp.magento.com:Magento/devdocs_internal into develop
2 parents 0202c09 + 715146a commit c799174

14 files changed

+272
-41
lines changed
4.72 KB
Loading
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
layout: default
3+
group: arch-guide
4+
subgroup: Architectural Basics
5+
title: Extensibility and modularity
6+
menu_title:
7+
menu_node:
8+
menu_order:
9+
github_link: architecture/extensibility.md
10+
---
11+
12+
<h2 id="m2arch-whatis-overview">Extensibility and modularity</h2>
13+
14+
15+
Product <i>extensibility</i> describes how easy it is to expand a product's feature set. An extensible product has been designed from its earliest planning stages for customization and enhancement. It is designed for ease in augmenting your installation's feature set, enriching current features, and integrating with third-party software
16+
17+
18+
Maximizing extensibility has been our goal through all aspects of Magento development. Core tasks such as Shipping are packaged as discrete modules, and you expand your storefront features by installing modules that you either buy from third-party vendors or create yourself. While logic specific to each shipping carrier is packaged in a discrete module, you can easily add or delete shipping providers by simply adding or deleting modules. The product framework provides common logic to control routing and other core application functions.
19+
20+
Explore Magento's potential for customization through these topics:
21+
22+
* Global product features that support extension development
23+
* Ease of frontend customization
24+
25+
26+
<h3>What makes a product extensible? </h3>
27+
28+
<i>Magento extensibility</i> describes the product's built-in ability for developers and merchants to routinely extend their storefront’s capabilities as their business grows.
29+
30+
31+
The effort involved in extending a product is influenced by:
32+
33+
* <b>architectural principles that guide product structure</b>. Central to the Magento model of software development is the practice of replacing or extending core code rather than editing it. This strategy enables you to maintain the integrity of the tested code we provide while still extensively customizing your storefront.
34+
35+
36+
* <b>open-source software to create and manage extensions</b>. Magento is built on open-source technologies, built by and for the development community. It uses Composer, an open-source tool, to manage dependencies. See <a href="{{ site.gdeurl }}architecture/tech-stack.html">Technology Stack</a> for a complete list.
37+
38+
* <b>coding standards</b>. Adherence to standard best practices for PHP and JavaScript code ensures that the code base is sound. Magento has adopted most of the Zend Framework Coding Standards for PHP. See <a href="{{ site.gdeurl }}coding-standards/bk-coding-standards.html">Coding Standards</a> for more information.
39+
40+
* <b>upgrade and versioning strategies</b>. Magento has well-defined upgrade and versioning strategies that can help you avoid any problems with software component dependencies. Add modules after confirming that the module version is compatible with the Magento Framework version. See <a href="{{ site.gdeurl }}install-gde/bk-install-guide.html">Installation Guide</a> for more information.
41+
42+
43+
<h3 id="m2arch-related">Related topics</h3>
44+
45+
46+
<a href="{{ site.gdeurl }}architecture/archi_perspectives/ABasics_intro.html">Architectural basics</a>
47+
48+
<a href="{{ site.gdeurl }}architecture/global_extensibility_features.html">Global product features that support extension development</a>
49+
50+
<a href="{{ site.gdeurl }}architecture/frontend_custom_strategies.html">Ease of frontend customization</a>
51+
52+
53+
54+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: default
3+
group: arch-guide
4+
subgroup:
5+
title: Security overview
6+
menu_title: Security
7+
menu_order:
8+
github_link: architecture/security_intro.md
9+
---
10+
11+
<h2 id="security_intro">Security overview</h2>
12+
Magento 2.0 includes the following security enhancements:
13+
14+
15+
16+
* <b>Enhanced password management</b>. Magento has strengthened the hashing algorithms (SHA-256) used in password management.
17+
18+
19+
* <b>Improved prevention of cross-site scripting (XSS) attacks by making escaped data the default</b>. The Magento Framework has adopted conventions that regulate the escaping of data in output. These conventions include the ability to escape output for HTML pages (HTML, JSON, and JavaScript) and email. Where possible, escaping is transparent to client code. See <a href="{{ site.gdeurl }}frontend-dev-guide/templates/template-security.html">Security measures against XSS attacks</a> in the Frontend Developer Guide.
20+
21+
* <b>Restricted permissions for file access</b>. Ability to set discrete file access for production and developer modes. This change tightens security on generated files, static files, and any files and directories created by Magento (including logs, backups, and reports). See <a href="{{ site.gdeurl }}install-gde/install/file-system-perms.html"> Set file system ownership and permissions </a> in the Installation Guide.
22+
23+
Magento also provides a CLI command that switches between developer mode and production mode. When you use the command to switch mode, the system also changes file system permissions. In production mode, directory permissions are set to 750, and file permissions are set to 640. In developer mode, directory permissions are set to 770, and file permissions are set to 660.
24+
25+
(Permissions need to vary due to user need, of course. For example, the Magento file system owner must own the file system. In contrast, the web server user needs read access only to the file system and write access to some directories (such as `pub/media`). And the web server user should not have write access to the entire Magento file system. For more information, see <a href="{{ site.gdeurl }}install-gde/prereq/apache-user.html"> Create the magento file system owner</a>.)
26+
27+
* <b>Improved prevention of clickjacking exploits</b>. Magento safeguards your store from clickjacking attacks by using an X-Frame-Options HTTP request header. For more information, see <a href="{{ site.gdeurl }}config-guide/secy/secy-xframe.html"> X-Frame-Options header</a>.
28+
29+
* <b>Use of non-default admin URL</b>. A default admin URL makes it easy to target attacks on specific locations using automated password guessing. To prevent against this type of attack, Magento by default creates a random Admin URI when you install the product. The CLI is provided so that you can see the password if you forget it. You can also use the CLI change this URI. Although the use of a non-default admin URL will not secure the site, its use will help prevent large-scale automated attacks. See <a href="{{ site.gdeurl }}install-gde/install/cli/install-cli-adminurl.html"> Display or change the Admin URI</a> in Configuration Guide for more information.
30+
31+
32+
33+
34+
<h2>Related topics</h2>
35+
<a href="{{ site.gdeurl }}config-guide/bk-config-guide.html">Configuration Guide</a>
36+
37+
38+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
layout: default
3+
group: arch-guide
4+
subgroup: Architectural Basics
5+
title: Storefront customization strategies
6+
menu_title: Storefront customization strategies
7+
menu_order:
8+
github_link: architecture/storefront_customization.md
9+
10+
---
11+
12+
<h2>Storefront customization strategies</h2>
13+
14+
We can generalize about the range of storefront customizations that the Magento supports. This range spans the simplest customizations, which involve only small additions to the default Magento storefront settings, to a complete replacement of Magento-provided HTML and CSS.
15+
16+
These four levels of potential storefront customization are listed in order of increasing complexity.
17+
18+
<h3>Extend Magento-Provided CSS</h3>
19+
Magento supplies a default theme and a LESS-based CSS set of styles. You can substantially change a storefront using CSS only. This uncomplicated strategy might suit projects with a limited budget, or might interest developers who create different skins for a site. A small business enter this process of storefront customization by buying a third-party developed theme from Magento Connect to extend the default values.
20+
21+
<h3>Replace PHTML template files</h3>
22+
In addition to extending the default CSS, you can generate different HTML markup. For example, you might need to add a missing CSS class name, or an add an extra `<div>` tag to achieve some visual effect. You might also need to tweak some JavaScript to cope with different HTML markup. This change is more demanding than simply extending Magento CSS, but is still within the grasp of smaller projects and leaner teams.
23+
24+
<h3>Replace Magento-Provided CSS</h3>
25+
Rather than edit the default CSS provided by Magento, you might decide to replace all the default storefront CSS code with your own. This strategy avoids tying a project to the Magento-provided CSS, but puts a greater burden on project development and integration. It also allows use of different CSS tools or technologies not provided with Magento. Partners who build their own set of CSS libraries could reuse these libraries on different customer projects. (These unique CSS libraries may help differentiate a partner from others in the market.)
26+
27+
In addition to replacing CSS files, you might need to replace small amounts of HTML and JavaScript.
28+
29+
30+
<h3>Replace Magento-Provided CSS, HTML, and JavaScript</h3>
31+
Delivering a sharply different shopping experience than the default Magento installation provides is a more substantial task. However, the tradeoff might be a more complicated experience integrating additional extensions into your installation in the future.
32+
33+
<div class="bs-callout bs-callout-info" id="info">
34+
<p>Note: Any customization of your storefront will work optimally, and provide the easiest path for later upgrades, if you follow the best practice of consistently compartmentalizing code by type. For example, keep all HTML in PHTML files; keep all JavaScript in JavaScript files.</p>
35+
</div>
36+
37+
<h3>Related topics</h3>
38+
39+
<a href="{{ site.gdeurl }}architecture/AStorefront_view.html">Magento storefront view</a>
40+
41+
<a href="{{ site.gdeurl }}frontend-dev-guide/bk-frontend-dev-guide.html">Frontend Developer Guide</a>
42+
43+
44+
<a href="{{ site.gdeurl }}javascript-dev-guide/bk-javascript-dev-guide.html">JavaScript Developer Guide</a>
45+
46+
47+

guides/v2.0/extension-dev-guide/Contribute_edg.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,25 @@
22
layout: default
33
group: Contributor Guide
44
subgroup:
5-
title: Contribute to Magento DevDocs!
6-
menu_title: Contribute to Magento DevDocs!
5+
title: Contribute to Magento DevDocs
6+
menu_title: Contribute to Magento DevDocs
77
menu_order: 100
8+
github_link: extension-dev-guide/Contribute_edg.md
89

910
---
1011

11-
We encourage our community members to add content; either by writing a full topic, adding new sections to existing topic, or even just adding a few sentences about something you know on an existing topic. Don't worry about perfect grammar or form; just get your brilliance down!!
12+
We encourage our users to add or correct Magento DevDoc content. Write a full topic, add a new section to an existing topic, or even just add a few sentences about something you know on an existing topic. Don't worry about grammar or form; we can fix that for you!
1213

13-
The files are mostly written in the markdown language (and HTML where needed).
14+
Magento Devdocs site content is written in [Markdown](https://daringfireball.net/projects/markdown/), and is kept in Github. If you know how to use Github, you can contribute to our docs.
1415

15-
To get started, review the <a href="{{ site.gdeurl }}contributor-guide/contributing.html">Contributor Guide</a> to learn about the process for code and doc contributions, including how to fork the repository and do a Pull Request to have your work submitted and reviewed.
16+
Review the Table of Contents in the left pane of the Guide, and determine which topic areas you can contribute to, or any that might be missing.
1617

17-
Then, review the Table of Contents in the left pane of the Guide, and determine which topic areas you can contribute to, or any that might be missing.
18-
19-
To add your knowledge to our Docs, you can:
18+
To add to Magento Docs:
2019

2120
* edit your local version of an existing file
2221
* use the <a href="{{ site.githuburl }}template.md">generic template</a> and write a brand new topic, we will find the right home for it in the appropriate Guide.
2322
* use an existing, empty template to write about a topic that we know we need, but haven't yet gotten around to writing
23+
* Create a Pull Request to have your contribution reviewed by the DevDocs team.
2424

25-
26-
Create a Pull Request to have your contribution reviewed by the DevDocs team.
27-
28-
Your contributions to our Docs and your experience with using Magento are very valued and appreciated. Let us know if you have any questions!
25+
Your contributions to Magento Docs informed by your experience with using Magento are highly valued and appreciated. Let us know if you have any questions!
2926

guides/v2.0/extension-dev-guide/build.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The following details the module building process:
2424

2525
* [Module file structure](module-file-structure.html)
2626
* [Define your configuration files](required-configuration-files.html)
27+
* [Component registration](component-registration.html)
2728
* [Create your module](create_module.html)
2829
* [Module load order](module-load-order.html)
2930
* [Enable your module](enable-module.html)
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
layout: default
3+
group: extension-dev-guide
4+
subgroup: 3_Build
5+
title: Component registration
6+
menu_title: Component registration
7+
menu_order: 4
8+
github_link: extension-dev-guide/composer-integration.md
9+
redirect_from: /guides/v1.0/extension-dev-guide/composer-integration.html
10+
11+
---
12+
##{{page.menu_title}}
13+
14+
15+
Magento components, including modules, themes, and languages, must be registered in the Magento system through the Magento `ComponentRegistrar` class.
16+
17+
Each component must have a file called `registration.php` in its root directory. For example, here is the `registration.php` file for Magento's [AdminNotification module](https://github.corp.ebay.com/magento2/magento2ce/blob/develop/app/code/Magento/AdminNotification/registration.php). Depending on the type of component, registration is performed through `registration.php` by adding to it as follows:
18+
19+
###Modules
20+
21+
Modules are registered with:
22+
23+
ComponentRegistrar::register(ComponentRegistrar::MODULE, '<VendorName_ModuleName>', __DIR__);
24+
25+
where &lt;VendorName> is the name of the company providing the module and &lt;ModuleName> is the name of the module.
26+
27+
#####Example
28+
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AdminNotification', __DIR__);
29+
<p>&nbsp;</p>
30+
31+
32+
###Themes
33+
34+
Themes are registered with:
35+
36+
ComponentRegistrar::register(ComponentRegistrar::THEME, '<area>/<vendor>/<theme name>', __DIR__);
37+
38+
where &lt;area> is the functional area of the module (frontend, controller, and so on.), &lt;vendor> is the name of the company providing the theme, and &lt;theme name> is the name of the theme.
39+
40+
41+
#####Example
42+
ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Magento/luma', __DIR__);
43+
44+
<p>&nbsp;</p>
45+
46+
47+
###Languages
48+
Languages are registered with:
49+
50+
ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, '<VendorName>_<packageName>', __DIR__);
51+
52+
where &lt;VendorName> is the name of the company providing the package and &lt;packageName> is the name of the package.
53+
54+
#####Example
55+
ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, 'magento_de_de', __DIR__);
56+
57+
<p>&nbsp;</p>
58+
59+
###Invoke registration.php in composer.json
60+
61+
After you create your `registration.php` file and you are creating [your module's composer.json file](create_module.html#add-the-module8217s-composerjson-file), remember to invoke your `registration.php` file in the autoload section of `composer.json`:
62+
63+
{
64+
"name": "Acme-vendor/bar-component",
65+
"autoload": {
66+
"psr-4": { "AcmeVendor\\BarComponent\\": "" },
67+
"files": [ "registration.php" ]
68+
}
69+
}
70+
71+
<p>&nbsp;</p>
72+
73+
##Sample registration.php file
74+
75+
{% highlight php startinline=true %}
76+
<?php
77+
/**
78+
* Copyright © 2015 Magento. All rights reserved.
79+
* See COPYING.txt for license details.
80+
*/
81+
\Magento\Framework\Component\ComponentRegistrar::register(
82+
\Magento\Framework\Component\ComponentRegistrar::MODULE,
83+
'Magento_AdminNotification',
84+
__DIR__
85+
);
86+
87+
{%endhighlight %}
88+
89+
##Next
90+
91+
[Create a module](create_module.html)

guides/v2.0/extension-dev-guide/create_module.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ group: extension-dev-guide
44
subgroup: 3_Build
55
title: Create a module
66
menu_title: Create a module
7-
menu_order: 4
7+
menu_order: 5
88
github_link: extension-dev-guide/create_module.md
99
redirect_from: /guides/v1.0/extension-dev-guide/create_module.html
1010
---
1111
##{{page.menu_title}}
1212

13-
Now that you have [determined your module&#8217;s initial file structure](module-file-structure.html) and have an idea of the [configuration files](required-configuration-files.html) you&#8217;ll need, you can create the module.
13+
Now that you have [determined your module&#8217;s initial file structure](module-file-structure.html), have an idea of the [configuration files](required-configuration-files.html) you&#8217;ll need, and you've [registered your module](component-registration.html), you can create the module.
14+
15+
1416

1517
##Add the module&#8217;s `module.xml` file
1618
Declare the module itself by adding a module.xml file in the `/etc` folder of your module.
@@ -31,7 +33,10 @@ The smallest working module.xml file would look something like this:
3133

3234

3335
{
34-
"name": "your-name/module-foobar",
36+
"name": "your-name/module-Acme",
37+
"autoload": {
38+
"psr-4": { "AcmeVendor\\BarComponent\\": "" },
39+
"files": [ "registration.php" ],
3540
"description": "Test module for Magento 2",
3641
"require": {
3742
"php": "~5.5.0|~5.6.0",

guides/v2.0/extension-dev-guide/enable-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group: extension-dev-guide
44
subgroup: 3_Build
55
title: Enable a module
66
menu_title: Enable a module
7-
menu_order: 6
7+
menu_order: 7
88
github_link: extension-dev-guide/enable-module.md
99

1010
---

guides/v2.0/extension-dev-guide/module-file-structure.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ github_link: extension-dev-guide/module-file-structure.md
1010
---
1111
##{{page.menu_title}}
1212

13-
Magento 2 looks for the files that make up a module, including configuration files, in particular places. Follow the predefined file structure to ensure that your module works as expected.
13+
Magento 2 looks for the files that make up a module, including configuration files, in particular places inside the module file structure. Follow the predefined file structure to ensure that your module works as expected.
1414

15+
A module can live anywhere under the Magento root directory. Regardless of where you add it, you must [register the module's location](component-registration.html).
1516

16-
###Magento 2 Module File Structure
17+
18+
19+
20+
###Magento 2 Module File structure
1721

1822

1923
A typical file structure for a Magento 2 module:
@@ -60,7 +64,8 @@ You can add subfolders inside your module folder as you need them (Block, Contro
6064

6165
Or, you could just add them at once:
6266

63-
mkdir Api && mkdir Block && mkdir Controller && mkdir etc && mkdir Helper && mkdir i18n && mkdir Model && mkdir view
67+
mkdir Api Block Controller etc Helper i18n Model view
68+
6469

6570
Make sure you add the `etc` folder; it is required, and is where most of the configuration files, including `module.xml`, are kept.
6671

guides/v2.0/extension-dev-guide/module-load-order.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group: extension-dev-guide
44
subgroup: 3_Build
55
title: Module load order
66
menu_title: Module load order
7-
menu_order: 5
7+
menu_order: 6
88
github_link: extension-dev-guide/module-load-order.md
99

1010
---

guides/v2.0/extension-dev-guide/prepare.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ Before you start building Magento modules, make sure you&#8217;ve got Magento an
1717

1818
* [Install Magento and any required dependencies]({{ site.gdeurl }}/install-gde/bk-install-guide.html)
1919
* [Composer integration](composer-integration.html)
20+
* [Component registration](component-resgistration.html)
2021
* [Set your mode to developer]({{ site.gdeurl }}/config-guide/bootstrap/magento-how-to-set.html)
2122
<!-- * [Determine your file structure](x) -->

0 commit comments

Comments
 (0)