Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #9 from tessig/master
Browse files Browse the repository at this point in the history
added possibility to delete config values.

Thank you very much! 👏
  • Loading branch information
SchumacherFM committed Nov 10, 2015
2 parents 8bf8497 + 8605a70 commit 76d9a05
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@

class Import extends AbstractImpex
{
/**
* @type string
*/
const DELETE_VALUE = '!!delete';

/**
* @var string
*/
Expand Down Expand Up @@ -158,7 +163,12 @@ protected function _getN98ConfigSets($path, array $config)
// Valid scope Write output
$value = str_replace("\r", '', addcslashes($value, '"'));
$value = str_replace("\n", '\\n', $value); // no multiline statements possible :-(
$return[] = 'config:set --scope=' . $scope . ' --scope-id=' . $scopeId . ' "' . $path . '" "' . $value . '"';

if ($value === self::DELETE_VALUE) {
$return[] = 'config:delete --scope=' . $scope . ' --scope-id=' . $scopeId . ' "' . $path . '"';
} else {
$return[] = 'config:set --scope=' . $scope . ' --scope-id=' . $scopeId . ' "' . $path . '" "' . $value . '"';
}
}
}

Expand Down

0 comments on commit 76d9a05

Please sign in to comment.