Skip to content

Commit

Permalink
reviewed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ardinis authored Apr 20, 2017
1 parent 3db84ed commit 7111821
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/files_external/lib/Command/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ protected function getOption(StorageConfig $mount, $key, OutputInterface $output
} else {
$value = $mount->getBackendOption($key);
}
if (!is_string($value) && json_decode(json_encode($value)) === $value) { // show bools and objects correctly
$value = json_encode($value);
}
$output->writeln($value);
}

Expand All @@ -101,6 +104,10 @@ protected function getOption(StorageConfig $mount, $key, OutputInterface $output
* @param OutputInterface $output
*/
protected function setOption(StorageConfig $mount, $key, $value, OutputInterface $output) {
$decoded = json_decode($value, true);
if (!is_null($decoded) && json_encode($decoded) === $value) {
$value = $decoded;
}
if ($key === 'mountpoint' || $key === 'mount_point') {
$mount->setMountPoint($value);
} else {
Expand Down

0 comments on commit 7111821

Please sign in to comment.