Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-config
Model
Config
Export
Comment.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Config\Model\Config\Export
;
7
8
use
Magento\Config\App\Config\Source\DumpConfigSourceInterface
;
9
use
Magento\Config\Model\Config\TypePool
;
10
use
Magento\Config\Model\Placeholder\PlaceholderFactory
;
11
use
Magento\Config\Model\Placeholder\PlaceholderInterface
;
12
use
Magento\Framework\App\Config\CommentInterface
;
13
use
Magento\Framework\App\ObjectManager
;
14
20
class
Comment
implements
CommentInterface
21
{
25
private
$placeholder;
26
30
private
$source;
31
37
private
$typePool;
38
44
public
function
__construct
(
45
PlaceholderFactory
$placeholderFactory,
46
DumpConfigSourceInterface
$source,
47
TypePool
$typePool =
null
48
) {
49
$this->placeholder = $placeholderFactory->
create
(PlaceholderFactory::TYPE_ENVIRONMENT);
50
$this->source =
$source
;
51
$this->typePool = $typePool ?:
ObjectManager::getInstance
()->get(TypePool::class);
52
}
53
63
public
function
get
()
64
{
65
$comments
= [];
66
67
foreach
($this->source->getExcludedFields() as
$path
) {
68
if
($this->typePool->isPresent(
$path
,
TypePool::TYPE_SENSITIVE
)) {
69
$comments
[] = $this->placeholder->generate(
$path
) .
' for '
.
$path
;
70
}
71
}
72
73
if
(!empty(
$comments
)) {
74
$comments
= array_merge([
75
'Shared configuration was written to config.php and system-specific configuration to env.php.'
,
76
'Shared configuration file (config.php) doesn\'t contain sensitive data for security reasons.'
,
77
'Sensitive data can be stored in the following environment variables:'
78
],
$comments
);
79
}
80
81
return
implode(PHP_EOL,
$comments
);
82
}
83
}
Magento\Config\Model\Placeholder\PlaceholderInterface
Definition:
PlaceholderInterface.php:15
Magento\Config\Model\Placeholder\PlaceholderFactory
Definition:
PlaceholderFactory.php:15
Magento\Framework\App\ObjectManager\getInstance
static getInstance()
Definition:
ObjectManager.php:33
$source
$source
Definition:
source.php:23
Magento\Framework\App\ObjectManager
Definition:
ConfigCache.php:8
Magento\Config\Model\Config\Export\Comment
Definition:
Comment.php:20
Magento\Config\Model\Config\Export\Comment\__construct
__construct(PlaceholderFactory $placeholderFactory, DumpConfigSourceInterface $source, TypePool $typePool=null)
Definition:
Comment.php:44
Magento\Config\Model\Config\Export
Definition:
Comment.php:6
Magento\Config\Model\Config\TypePool
Definition:
TypePool.php:18
Magento\Config\Model\Placeholder\PlaceholderFactory\create
create($type)
Definition:
PlaceholderFactory.php:50
Magento\Framework\App\Config\CommentInterface
Definition:
CommentInterface.php:13
$comments
$comments
Definition:
creditmemo_comments_for_search.php:30
Magento\Config\App\Config\Source\DumpConfigSourceInterface
Definition:
DumpConfigSourceInterface.php:15
Magento\Config\Model\Config\TypePool\TYPE_SENSITIVE
const TYPE_SENSITIVE
Definition:
TypePool.php:23
$path
$path
Definition:
import_with_filesystem_images.php:14