Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cade759

Browse files
shiftedrealitySteve Johnson
authored and
Steve Johnson
committed
[Falcons] Documentation for TypeList (magento#766)
* MAGETWO-66773: Documentation for TypeList * MAGETWO-66773: Documentation for TypeList * MAGETWO-66773: Documentation for TypeList * Edit sensitive and system-specific configuration in di.xml
1 parent 96e1a9e commit cade759

File tree

1 file changed

+41
-11
lines changed

1 file changed

+41
-11
lines changed

guides/v2.2/extension-dev-guide/build/di-xml-file.md

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -320,31 +320,46 @@ The `shared` property determines the lifestyle of both `argument` and `type` con
320320
In this example `Magento\Filesystem` is not shared, so all clients will retrieve separate instances of `Magento\Filesystem`.
321321
Also, every instance of `Magento\Filesystem` will get separate instance of `$adapter`, because it too is non-shared.
322322
323-
## Sensitive configuration settings {#ext-di-sens}
324-
A _sensitive configuration setting_ is one you can manage using either a configuration variable or using the Magento Admin. A sensitive setting is _not_ stored in `config.php` and cannot be shared between environments.
323+
## Sensitive and system-specific configuration settings {#ext-di-sens}
324+
In the Magento [split deployment model]({{ page.baseurl }}), there are the following types of configuration settings:
325325
326-
Typical examples are payment gateway API keys, user names, or passwords.
326+
* Shared, which can be shared between systems using `app/etc/config.php`
327+
* System-specific, which are unique to a particular system.
327328
328-
To specify a sensitive configuration value, add a reference to [`Magento\Config\Model\Config\Export\ExcludeList`]({{ site.mage2200url }}app/code/Magento/Config/Model/Config/Export/ExcludeList.php){:target="_blank"} to `di.xml` as follows:
329+
Typical examples include host names and ports.
330+
* Sensitive, managed using either an environment variable, using the [`magento config:sensitive:set` command]({{ page.baseurl }}) or using the Magento Admin.
331+
332+
Typical examples are payment gateway API keys, user names, or passwords.
333+
334+
You cannot share either system-specific or sensitive settings between development and production systems.
335+
336+
To specify either a system-specific or sensitive configuration value, add a reference to [`Magento\Config\Model\Config\TypePool`]({{ site.mage2200url }}app/code/Magento/Config/Model/Config/TypePool.php){:target="_blank"} to `di.xml` as follows:
329337
330338
{% highlight php startinline=true %}
331-
<type name="Magento\Config\Model\Config\Export\ExcludeList">
339+
<type name="Magento\Config\Model\Config\TypePool">
332340
<arguments>
333-
<argument name="configs" xsi:type="array">
341+
<argument name="{sensitive|environment}" xsi:type="array">
334342
<item name="<config path>" xsi:type="string">1</item>
335343
</argument>
336344
</arguments>
337345
</type>
338346
{% endhighlight %}
339347
340-
where `<config path>` is a `/`-delimited string that uniquely identifies this configuration setting.
348+
where `<argument name="{sensitive|environment}` specifies the type of value: either sensitive or system-specific.
341349
342-
For example,
350+
and `<config path>` is a `/`-delimited string that uniquely identifies this configuration setting.
351+
352+
<div class="bs-callout bs-callout-info" id="merging-info" markdown="1">
353+
The same configuration setting can be both sensitive and system-specific.
354+
</div>
355+
356+
### Sensitive setting
357+
An example of a sensitive setting follows:
343358
344359
{% highlight php startinline=true %}
345-
<type name="Magento\Config\Model\Config\Export\ExcludeList">
360+
<type name="Magento\Config\Model\Config\TypePool">
346361
<arguments>
347-
<argument name="configs" xsi:type="array">
362+
<argument name="sensitive" xsi:type="array">
348363
<item name="payment/test/password" xsi:type="string">1</item>
349364
</argument>
350365
</arguments>
@@ -356,12 +371,27 @@ After specifying the sensitive setting, use the following commands to verify it:
356371
php bin/magento cache:clean
357372
php bin/magento app:config:dump
358373
359-
A message similar to the following displays:
374+
A message similar to the following is displayed:
360375
361376
The configuration file doesn't contain sensitive data for security reasons. Sensitive data can be stored in the following environment variables:
362377
CONFIG__DEFAULT__PAYMENT__TEST__PASWORD for payment/test/password
363378
Done.
364379
380+
### System-specific settings
381+
Like sensitive settings, system-specific settings are written to `app/etc/env.php` only.
382+
383+
A configuration example follows:
384+
385+
{% highlight php startinline=true %}
386+
<type name="Magento\Config\Model\Config\TypePool">
387+
<arguments>
388+
<argument name="environemnt" xsi:type="array">
389+
<item name="<config path>" xsi:type="string">1</item>
390+
</argument>
391+
</arguments>
392+
</type>
393+
{% endhighlight %}
394+
365395
A complete list of Magento configuration paths can be found in:
366396
367397
* [TBD]()

0 commit comments

Comments
 (0)