Skip to content

Commit d684eef

Browse files
author
Bohdan Korablov
committed
MAGETWO-64602: Sync config file with DB: Validation
1 parent 58f48ab commit d684eef

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

app/code/Magento/Deploy/Model/DeploymentConfig/DataCollector.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
use Magento\Framework\App\DeploymentConfig;
99

1010
/**
11-
* Config data collector of specific sections which are defined in di.xml
11+
* Config data collector of specific sections in configuration files which are defined in di.xml
1212
*
13-
* E.g.
13+
* E.g., definition of sections which are needed to import:
1414
* ```xml
1515
* <type name="Magento\Deploy\Model\DeploymentConfig\ImporterPool">
1616
* <arguments>
@@ -20,9 +20,22 @@
2020
* </arguments>
2121
* </type>
2222
* ```
23+
* Example, how sections are stored with their config data in configuration files:
24+
* ```php
25+
* [
26+
* 'scopes' => [...],
27+
* 'system' => [...],
28+
* 'themes' => [...],
29+
* ...
30+
* ]
31+
* ```
32+
*
2333
* In here we define section "scopes" and its importer Magento\Store\Model\StoreImporter.
2434
* The data of this section will be collected then will be used in importing process from the shared configuration
2535
* files to appropriate application sources.
36+
*
37+
* @see \Magento\Deploy\Console\Command\App\ConfigImport\Importer::import()
38+
* @see \Magento\Deploy\Model\DeploymentConfig\Hash::regenerate()
2639
*/
2740
class DataCollector
2841
{

app/code/Magento/Deploy/Model/DeploymentConfig/Hash.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
/**
1515
* Saves and Retrieves deployment configuration hash.
1616
*
17-
* We need the hash of configuration data for its validation.
17+
* This hash keeps version of last imported data. Hash is used to define whether data was updated
18+
* and import is required.
19+
*
20+
* @see \Magento\Deploy\Model\DeploymentConfig\Validator::isValid()
1821
*/
1922
class Hash
2023
{
@@ -72,10 +75,10 @@ public function __construct(
7275
/**
7376
* Updates hash in the storage.
7477
*
75-
* The hash is updated based on configuration data from shared configuration files.
78+
* The hash is generated based on data from configuration files
7679
*
7780
* @return void
78-
* @throws LocalizedException is thrown when import has failed
81+
* @throws LocalizedException is thrown when hash was not saved
7982
*/
8083
public function regenerate()
8184
{

app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public function __construct(ObjectManagerInterface $objectManager, array $import
7272
}
7373

7474
/**
75-
* Retrieves sections from deployment configuration files which need to import into
76-
* appropriate application sources.
75+
* Retrieves names of sections for configuration files whose data is read from these files for import
76+
* to appropriate application sources.
7777
*
7878
* @return array the list of sections
7979
* E.g.

0 commit comments

Comments
 (0)