diff --git a/Model/File/Writer/AbstractWriter.php b/Model/File/Writer/AbstractWriter.php index 3583652..90151e3 100644 --- a/Model/File/Writer/AbstractWriter.php +++ b/Model/File/Writer/AbstractWriter.php @@ -93,20 +93,8 @@ protected function _prepareDataHierarchical(array $exportData) { $return = array(); foreach ($exportData as $row) { - $pathDetails = explode('/', $row['path']); - if (!isset($return[$pathDetails[0]])) { - $return[$pathDetails[0]] = array(); - } - if (!isset($return[$pathDetails[0]][$pathDetails[1]])) { - $return[$pathDetails[0]][$pathDetails[1]] = array(); - } - if (!isset($return[$pathDetails[0]][$pathDetails[1]][$pathDetails[2]])) { - $return[$pathDetails[0]][$pathDetails[1]][$pathDetails[2]] = array(); - } - if (!isset($return[$pathDetails[0]][$pathDetails[1]][$pathDetails[2]][$row['scope']])) { - $return[$pathDetails[0]][$pathDetails[1]][$pathDetails[2]][$row['scope']] = array(); - } - $return[$pathDetails[0]][$pathDetails[1]][$pathDetails[2]][$row['scope']][$row['scope_id']] = $row['value']; + list($firstPart, $secondPart, $thirdPart) = explode('/', $row['path'], 3); + $return[$firstPart][$secondPart][$thirdPart][$row['scope']][$row['scope_id']] = $row['value']; } return $return; diff --git a/README.md b/README.md index 7fd6261..d4dd841 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This module is inspired by the awesome n98-magerun plugin "HarrisStreet ImpEx" b ## Facts -Version: 2.2.1 +Version: 2.2.2 ## Functionality