-
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.
[90] [17] Read API :: Web-Api tests :: Magento\GraphQl\Catalog\MediaG…
…alleryTest::testProductSmallImageUrlPlaceholder #90
- Loading branch information
Showing
2 changed files
with
87 additions
and
0 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
86 changes: 86 additions & 0 deletions
86
setup/src/Magento/Setup/Model/ConfigOptionsList/Directory.php
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,86 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Setup\Model\ConfigOptionsList; | ||
|
||
use Magento\Framework\App\DeploymentConfig; | ||
use Magento\Framework\Config\Data\ConfigData; | ||
use Magento\Framework\Config\File\ConfigFilePool; | ||
use Magento\Framework\Setup\ConfigOptionsListInterface; | ||
use Magento\Framework\Setup\Option\SelectConfigOption; | ||
|
||
/** | ||
* Deployment configuration options for the folders. | ||
*/ | ||
class Directory implements ConfigOptionsListInterface | ||
{ | ||
/** | ||
* Input ket for config command. | ||
*/ | ||
const INPUT_KEY_DOCUMENT_ROOT_IS_PUB = 'document-root-is-pub'; | ||
|
||
/** | ||
* Path in in configuration. | ||
*/ | ||
const CONFIG_PATH_DOCUMENT_ROOT_IS_PUB = 'directories/document_root_is_pub'; | ||
|
||
/** | ||
* The available configuration values. | ||
* | ||
* @var array | ||
*/ | ||
private $selectOptions = [true, false]; | ||
|
||
/** | ||
* @param array $options | ||
* @param DeploymentConfig $deploymentConfig | ||
* @return ConfigData|ConfigData[] | ||
*/ | ||
public function createConfig(array $options, DeploymentConfig $deploymentConfig) | ||
{ | ||
$configData = new ConfigData(ConfigFilePool::APP_ENV); | ||
if (isset($options[self::INPUT_KEY_DOCUMENT_ROOT_IS_PUB])) { | ||
$configData->set( | ||
self::CONFIG_PATH_DOCUMENT_ROOT_IS_PUB, | ||
\filter_var($options[self::INPUT_KEY_DOCUMENT_ROOT_IS_PUB], FILTER_VALIDATE_BOOLEAN) | ||
); | ||
} | ||
|
||
return $configData; | ||
} | ||
|
||
/** | ||
* Return options from Directory configuration. | ||
* | ||
* @return \Magento\Framework\Setup\Option\AbstractConfigOption[]|SelectConfigOption[] | ||
*/ | ||
public function getOptions() | ||
{ | ||
return [ | ||
new SelectConfigOption( | ||
self::INPUT_KEY_DOCUMENT_ROOT_IS_PUB, | ||
SelectConfigOption::FRONTEND_WIZARD_SELECT, | ||
$this->selectOptions, | ||
self::CONFIG_PATH_DOCUMENT_ROOT_IS_PUB, | ||
'Flag to show is Pub is on root, can be true or false only', | ||
false | ||
), | ||
]; | ||
} | ||
|
||
/** | ||
* Validate options. | ||
* | ||
* @param array $options | ||
* @param DeploymentConfig $deploymentConfig | ||
* @return array|string[] | ||
*/ | ||
public function validate(array $options, DeploymentConfig $deploymentConfig) | ||
{ | ||
return []; | ||
} | ||
} |