Skip to content

Commit 4989083

Browse files
committed
[90] [17] Read API :: Web-Api tests :: Magento\GraphQl\Catalog\MediaGalleryTest::testProductSmallImageUrlPlaceholder #90
1 parent 9fa0546 commit 4989083

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

setup/src/Magento/Setup/Model/ConfigOptionsList.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class ConfigOptionsList implements ConfigOptionsListInterface
5353
\Magento\Setup\Model\ConfigOptionsList\Cache::class,
5454
\Magento\Setup\Model\ConfigOptionsList\PageCache::class,
5555
\Magento\Setup\Model\ConfigOptionsList\Lock::class,
56+
\Magento\Setup\Model\ConfigOptionsList\Directory::class,
5657
];
5758

5859
/**
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Setup\Model\ConfigOptionsList;
9+
10+
use Magento\Framework\App\DeploymentConfig;
11+
use Magento\Framework\Config\Data\ConfigData;
12+
use Magento\Framework\Config\File\ConfigFilePool;
13+
use Magento\Framework\Setup\ConfigOptionsListInterface;
14+
use Magento\Framework\Setup\Option\SelectConfigOption;
15+
16+
/**
17+
* Deployment configuration options for the folders.
18+
*/
19+
class Directory implements ConfigOptionsListInterface
20+
{
21+
/**
22+
* Input ket for config command.
23+
*/
24+
const INPUT_KEY_DOCUMENT_ROOT_IS_PUB = 'document-root-is-pub';
25+
26+
/**
27+
* Path in in configuration.
28+
*/
29+
const CONFIG_PATH_DOCUMENT_ROOT_IS_PUB = 'directories/document_root_is_pub';
30+
31+
/**
32+
* The available configuration values.
33+
*
34+
* @var array
35+
*/
36+
private $selectOptions = [true, false];
37+
38+
/**
39+
* @param array $options
40+
* @param DeploymentConfig $deploymentConfig
41+
* @return ConfigData|ConfigData[]
42+
*/
43+
public function createConfig(array $options, DeploymentConfig $deploymentConfig)
44+
{
45+
$configData = new ConfigData(ConfigFilePool::APP_ENV);
46+
if (isset($options[self::INPUT_KEY_DOCUMENT_ROOT_IS_PUB])) {
47+
$configData->set(
48+
self::CONFIG_PATH_DOCUMENT_ROOT_IS_PUB,
49+
\filter_var($options[self::INPUT_KEY_DOCUMENT_ROOT_IS_PUB], FILTER_VALIDATE_BOOLEAN)
50+
);
51+
}
52+
53+
return $configData;
54+
}
55+
56+
/**
57+
* Return options from Directory configuration.
58+
*
59+
* @return \Magento\Framework\Setup\Option\AbstractConfigOption[]|SelectConfigOption[]
60+
*/
61+
public function getOptions()
62+
{
63+
return [
64+
new SelectConfigOption(
65+
self::INPUT_KEY_DOCUMENT_ROOT_IS_PUB,
66+
SelectConfigOption::FRONTEND_WIZARD_SELECT,
67+
$this->selectOptions,
68+
self::CONFIG_PATH_DOCUMENT_ROOT_IS_PUB,
69+
'Flag to show is Pub is on root, can be true or false only',
70+
false
71+
),
72+
];
73+
}
74+
75+
/**
76+
* Validate options.
77+
*
78+
* @param array $options
79+
* @param DeploymentConfig $deploymentConfig
80+
* @return array|string[]
81+
*/
82+
public function validate(array $options, DeploymentConfig $deploymentConfig)
83+
{
84+
return [];
85+
}
86+
}

0 commit comments

Comments
 (0)