Skip to content

Commit fa1503b

Browse files
author
Egor Shitikov
committed
MAGETWO-34014: Create fixture or script for changing Magento FPC ttl
1 parent e2dbf63 commit fa1503b

File tree

7 files changed

+52
-128
lines changed

7 files changed

+52
-128
lines changed

dev/tools/performance-toolkit/fixtures/configs_apply.php

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,25 @@ class ConfigsApplyFixture extends \Magento\ToolkitFramework\Fixture
1212
/**
1313
* @var int
1414
*/
15-
protected $priority = 100;
15+
protected $priority = 150;
1616

1717
/**
1818
* {@inheritdoc}
1919
*/
2020
public function execute()
2121
{
22-
$configs = \Magento\ToolkitFramework\Config::getInstance()->getValue('configs', array());
23-
22+
$configs = \Magento\ToolkitFramework\Config::getInstance()->getValue('configs', []);
2423
$this->application->resetObjectManager();
2524
/**
2625
* @var \Magento\Framework\App\Config\Value $configData
2726
*/
2827
$configData = $this->application->getObjectManager()->create('Magento\Framework\App\Config\Value');
29-
30-
foreach ($configs as $config) {
31-
try {
32-
$configData->setPath($config['path'])
33-
->setScope($config['scope'])
34-
->setScopeId($config['scopeId'])
35-
->setValue($config['value'])
36-
->save();
37-
} catch (\Exception $e) {
38-
if (strpos($e->getMessage(), '1062 Duplicate entry')) {
39-
echo 'Config value the same' . PHP_EOL;
40-
} else {
41-
throw new Exception('Error update config');
42-
}
43-
}
28+
foreach ($configs['config'] as $config) {
29+
$configData->setPath($config['path'])
30+
->setScope($config['scope'])
31+
->setScopeId($config['scopeId'])
32+
->setValue($config['value'])
33+
->save();
4434
}
4535
$this->application->getObjectManager()->get('Magento\Framework\App\CacheInterface')
4636
->clean([\Magento\Framework\App\Config::CACHE_TAG]);

dev/tools/performance-toolkit/fixtures/disable_form_key_usage.php

Lines changed: 0 additions & 54 deletions
This file was deleted.

dev/tools/performance-toolkit/fixtures/shipping_flatrate_enabled.php

Lines changed: 0 additions & 54 deletions
This file was deleted.

dev/tools/performance-toolkit/profiles/ce/extra_large.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,19 @@
1818
<cart_price_rules>100</cart_price_rules> <!-- Number of shopping cart price rules -->
1919
<cart_price_rules_floor>5</cart_price_rules_floor> <!-- The price rule condition: minimum products amount in shopping cart for price rule to be applied -->
2020
<customers>5000</customers> <!-- Number of customers to generate -->
21+
<configs> <!-- Config variables and values for change -->
22+
<config>
23+
<path>admin/security/use_form_key</path>
24+
<scope>default</scope>
25+
<scopeId>0</scopeId>
26+
<value>0</value>
27+
</config>
28+
<config>
29+
<path>carriers/flatrate/active</path>
30+
<scope>default</scope>
31+
<scopeId>0</scopeId>
32+
<value>1</value>
33+
</config>
34+
</configs>
2135
</profile>
2236
</config>

dev/tools/performance-toolkit/profiles/ce/large.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,19 @@
1818
<cart_price_rules>50</cart_price_rules> <!-- Number of shopping cart price rules -->
1919
<cart_price_rules_floor>2</cart_price_rules_floor> <!-- The price rule condition: minimum products amount in shopping cart for price rule to be applied -->
2020
<customers>2000</customers> <!-- Number of customers to generate -->
21+
<configs> <!-- Config variables and values for change -->
22+
<config>
23+
<path>admin/security/use_form_key</path>
24+
<scope>default</scope>
25+
<scopeId>0</scopeId>
26+
<value>0</value>
27+
</config>
28+
<config>
29+
<path>carriers/flatrate/active</path>
30+
<scope>default</scope>
31+
<scopeId>0</scopeId>
32+
<value>1</value>
33+
</config>
34+
</configs>
2135
</profile>
2236
</config>

dev/tools/performance-toolkit/profiles/ce/medium.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,19 @@
1818
<cart_price_rules>20</cart_price_rules> <!-- Number of shopping cart price rules -->
1919
<cart_price_rules_floor>2</cart_price_rules_floor> <!-- The price rule condition: minimum products amount in shopping cart for price rule to be applied -->
2020
<customers>200</customers> <!-- Number of customers to generate -->
21+
<configs> <!-- Config variables and values for change -->
22+
<config>
23+
<path>admin/security/use_form_key</path>
24+
<scope>default</scope>
25+
<scopeId>0</scopeId>
26+
<value>0</value>
27+
</config>
28+
<config>
29+
<path>carriers/flatrate/active</path>
30+
<scope>default</scope>
31+
<scopeId>0</scopeId>
32+
<value>1</value>
33+
</config>
34+
</configs>
2135
</profile>
2236
</config>

dev/tools/performance-toolkit/profiles/ce/small.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
<path>admin/security/use_form_key</path>
2424
<scope>default</scope>
2525
<scopeId>0</scopeId>
26-
<value>1</value>
26+
<value>0</value>
2727
</config>
2828
<config>
2929
<path>carriers/flatrate/active</path>
30-
<scope>default2</scope>
30+
<scope>default</scope>
3131
<scopeId>0</scopeId>
3232
<value>1</value>
3333
</config>

0 commit comments

Comments
 (0)