Skip to content

Commit

Permalink
ENGCOM-7265: #27091 Removed array print while setup upgrade #27567
Browse files Browse the repository at this point in the history
  • Loading branch information
slavvka authored Jun 24, 2020
2 parents 54ee26c + 758a51b commit 6382421
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 8 additions & 6 deletions setup/src/Magento/Setup/Model/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
use Magento\Setup\Module\SetupFactory;
use Magento\Setup\Validator\DbValidator;
use Magento\Store\Model\Store;
use Magento\Framework\App\Cache\Manager;

/**
* Class Installer contains the logic to install Magento application.
Expand Down Expand Up @@ -1311,8 +1312,8 @@ public function uninstall()
*/
private function updateCaches($isEnabled, $types = [])
{
/** @var \Magento\Framework\App\Cache\Manager $cacheManager */
$cacheManager = $this->objectManagerProvider->get()->create(\Magento\Framework\App\Cache\Manager::class);
/** @var Manager $cacheManager */
$cacheManager = $this->objectManagerProvider->get()->create(Manager::class);

$availableTypes = $cacheManager->getAvailableTypes();
$types = empty($types) ? $availableTypes : array_intersect($availableTypes, $types);
Expand All @@ -1331,8 +1332,9 @@ function (string $key) use ($types) {
);

$this->log->log('Current status:');
// phpcs:ignore Magento2.Functions.DiscouragedFunction
$this->log->log(print_r($cacheStatus, true));
foreach ($cacheStatus as $cache => $status) {
$this->log->log(sprintf('%s: %d', $cache, $status));
}
}

/**
Expand All @@ -1344,8 +1346,8 @@ function (string $key) use ($types) {
*/
private function cleanCaches()
{
/** @var \Magento\Framework\App\Cache\Manager $cacheManager */
$cacheManager = $this->objectManagerProvider->get()->get(\Magento\Framework\App\Cache\Manager::class);
/** @var Manager $cacheManager */
$cacheManager = $this->objectManagerProvider->get()->get(Manager::class);
$types = $cacheManager->getAvailableTypes();
$cacheManager->clean($types);
$this->log->log('Cache cleared successfully');
Expand Down
10 changes: 4 additions & 6 deletions setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,20 +450,19 @@ public function installDataProvider()
['Installing user configuration...'],
['Enabling caches:'],
['Current status:'],
[print_r(['foo' => 1, 'bar' => 1], true)],
['foo: 1'],
['bar: 1'],
['Installing data...'],
['Data install/update:'],
['Disabling caches:'],
['Current status:'],
[print_r([], true)],
['Module \'Foo_One\':'],
['Module \'Bar_Two\':'],
['Data post-updates:'],
['Module \'Foo_One\':'],
['Module \'Bar_Two\':'],
['Enabling caches:'],
['Current status:'],
[print_r([], true)],
['Caches clearing:'],
['Cache cleared successfully'],
['Disabling Maintenance Mode:'],
Expand Down Expand Up @@ -502,20 +501,19 @@ public function installDataProvider()
['Installing user configuration...'],
['Enabling caches:'],
['Current status:'],
[print_r(['foo' => 1, 'bar' => 1], true)],
['foo: 1'],
['bar: 1'],
['Installing data...'],
['Data install/update:'],
['Disabling caches:'],
['Current status:'],
[print_r([], true)],
['Module \'Foo_One\':'],
['Module \'Bar_Two\':'],
['Data post-updates:'],
['Module \'Foo_One\':'],
['Module \'Bar_Two\':'],
['Enabling caches:'],
['Current status:'],
[print_r([], true)],
['Installing admin user...'],
['Caches clearing:'],
['Cache cleared successfully'],
Expand Down

0 comments on commit 6382421

Please sign in to comment.