Skip to content

Commit

Permalink
Do not list reverted patches as applied
Browse files Browse the repository at this point in the history
  • Loading branch information
7ochem committed Jul 13, 2017
1 parent 5770ede commit 8c6397b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Hypernode/Magento/Command/Hypernode/Patches/ListCommand.php
Expand Up @@ -134,12 +134,21 @@ protected function _loadPatchFile()
}
$ioAdapter->open(array('path' => $ioAdapter->dirname($this->patchFile)));
$ioAdapter->streamOpen($this->patchFile, 'r');

while ($buffer = $ioAdapter->streamRead()) {
if (stristr($buffer, '|')) {
$patchInfo = array_map('trim', explode('|', $buffer));
$this->appliedPatches[$this->_formatPatchName($patchInfo[1], $patchInfo[3])] = true;
if (false === strpos($buffer, '|')) {
continue;
}

$patchInfo = array_map('trim', explode('|', $buffer));
$patchName = $this->_formatPatchName($patchInfo[1], $patchInfo[3]);
if (in_array('REVERTED', $patchInfo)) {
unset($this->appliedPatches[$patchName]);
} else {
$this->appliedPatches[$patchName] = true;
}
}

$ioAdapter->streamClose();
}

Expand Down

0 comments on commit 8c6397b

Please sign in to comment.