Skip to content

Commit 7eca944

Browse files
MAGETWO-58594: Static Assets deployment throws errors when redis is used for cache after PR 389
fixes after code_review
1 parent 0a74dfe commit 7eca944

File tree

2 files changed

+7
-37
lines changed

2 files changed

+7
-37
lines changed

app/code/Magento/Deploy/Console/Command/DeployStaticContentCommand.php

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -419,13 +419,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
419419
}
420420
}
421421

422-
try {
423-
$this->disableCache();
424-
return $deployManager->deploy();
425-
426-
} finally {
427-
$this->enableCache();
428-
}
422+
$this->mockCache();
423+
return $deployManager->deploy();
429424
}
430425

431426
/**
@@ -493,26 +488,12 @@ private function prepareDeployableEntities($filesUtil)
493488
*
494489
* @return void
495490
*/
496-
private function disableCache()
491+
private function mockCache()
497492
{
498493
$this->objectManager->configure([
499494
'preferences' => [
500495
Cache::class => DummyCache::class
501496
]
502497
]);
503498
}
504-
505-
/**
506-
* Unmock Cache class
507-
*
508-
* @return void
509-
*/
510-
private function enableCache()
511-
{
512-
$this->objectManager->configure([
513-
'preferences' => [
514-
Cache::class => Cache::class
515-
]
516-
]);
517-
}
518499
}

lib/internal/Magento/Framework/App/Cache/Type/Dummy.php

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ public function getFrontend()
2222
/**
2323
* Pretend to load data from cache by id
2424
*
25-
* @param string $identifier
26-
* @return null
27-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
25+
* {@inheritdoc}
2826
*/
2927
public function load($identifier)
3028
{
@@ -34,12 +32,7 @@ public function load($identifier)
3432
/**
3533
* Pretend to save data
3634
*
37-
* @param string $data
38-
* @param string $identifier
39-
* @param array $tags
40-
* @param int $lifeTime
41-
* @return bool
42-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
35+
* {@inheritdoc}
4336
*/
4437
public function save($data, $identifier, $tags = [], $lifeTime = null)
4538
{
@@ -49,9 +42,7 @@ public function save($data, $identifier, $tags = [], $lifeTime = null)
4942
/**
5043
* Pretend to remove cached data by identifier
5144
*
52-
* @param string $identifier
53-
* @return bool
54-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
45+
* {@inheritdoc}
5546
*/
5647
public function remove($identifier)
5748
{
@@ -61,9 +52,7 @@ public function remove($identifier)
6152
/**
6253
* Pretend to clean cached data by specific tag
6354
*
64-
* @param array $tags
65-
* @return bool
66-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
55+
* {@inheritdoc}
6756
*/
6857
public function clean($tags = [])
6958
{

0 commit comments

Comments
 (0)