Skip to content

Commit 8248518

Browse files
author
Oleksandr Iegorov
committed
MAGETWO-95853: Can't flush Images cache in admin
1 parent ea180c8 commit 8248518

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

lib/internal/Magento/Framework/Filesystem/Directory/Write.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ public function delete($path = null)
193193
} catch (FileSystemException $e) {
194194
$exceptionMessages[] = $e->getMessage();
195195
}
196-
}
197-
if (!empty($exceptionMessages)) {
198-
throw new FileSystemException(
199-
new \Magento\Framework\Phrase(
200-
\implode(' ', $exceptionMessages)
201-
)
202-
);
196+
if (!empty($exceptionMessages)) {
197+
throw new FileSystemException(
198+
new \Magento\Framework\Phrase(
199+
\implode(' ', $exceptionMessages)
200+
)
201+
);
202+
}
203203
}
204204
return true;
205205
}

lib/internal/Magento/Framework/Filesystem/Driver/File.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,14 @@ public function deleteDirectory($path)
405405
$iterator = new \FilesystemIterator($path, $flags);
406406
/** @var \FilesystemIterator $entity */
407407
foreach ($iterator as $entity) {
408-
if ($entity->isDir()) {
409-
try {
408+
try {
409+
if ($entity->isDir()) {
410410
$this->deleteDirectory($entity->getPathname());
411-
} catch (FileSystemException $exception) {
412-
$exceptionMessages[] = $exception->getMessage();
411+
} else {
412+
$this->deleteFile($entity->getPathname());
413413
}
414-
} else {
415-
$this->deleteFile($entity->getPathname());
414+
} catch (FileSystemException $exception) {
415+
$exceptionMessages[] = $exception->getMessage();
416416
}
417417
}
418418
if (!empty($exceptionMessages)) {

0 commit comments

Comments
 (0)