-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #889 from magento-falcons/MAGETWO-65085
Task - MAGETWO-65085 [PR] Delivery of deployment improvements Story - MAGETWO-63084 Sync config file with DB: Validation - MAGETWO-62736 Rename config.local.php file, use env.php file as configs storage - MAGETWO-63381 CLI Improvements: Configuration management - Hide sensitive values from config:show command - MAGETWO-64223 CLI Improvements: Configuration management - Add validations to config:set command - MAGETWO-63095 User can change the Interface Locale only to locales that are already deployed.
- Loading branch information
Showing
79 changed files
with
3,991 additions
and
601 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/** | ||
* Copyright © 2013-2017 Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Config\Model\Config; | ||
|
||
use Magento\Framework\Exception\ValidatorException; | ||
|
||
/** | ||
* Validates the config path by config structure schema. | ||
*/ | ||
class PathValidator | ||
{ | ||
/** | ||
* The config structure. | ||
* | ||
* @var Structure | ||
*/ | ||
private $structure; | ||
|
||
/** | ||
* @param Structure $structure The config structure | ||
*/ | ||
public function __construct(Structure $structure) | ||
{ | ||
$this->structure = $structure; | ||
} | ||
|
||
/** | ||
* Checks whether the config path present in configuration structure. | ||
* | ||
* @param string $path The config path | ||
* @return true The result of validation | ||
* @throws ValidatorException If provided path is not valid | ||
*/ | ||
public function validate($path) | ||
{ | ||
$allPaths = $this->structure->getFieldPaths(); | ||
|
||
if (!array_key_exists($path, $allPaths)) { | ||
throw new ValidatorException(__('The "%1" path does not exist', $path)); | ||
} | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.