Merge pull request #21663 from owncloud/occ-external-mountpoint

allow setting mountpoint with occ files_external:config
This commit is contained in:
Thomas Müller 2016-01-13 10:30:17 +01:00
commit a11f6093b7
1 changed files with 10 additions and 2 deletions

View File

@ -88,7 +88,11 @@ class Config extends Base {
* @param OutputInterface $output * @param OutputInterface $output
*/ */
protected function getOption(StorageConfig $mount, $key, OutputInterface $output) { protected function getOption(StorageConfig $mount, $key, OutputInterface $output) {
$value = $mount->getBackendOption($key); if ($key === 'mountpoint' || $key === 'mount_point') {
$value = $mount->getMountPoint();
} else {
$value = $mount->getBackendOption($key);
}
if (!is_string($value)) { // show bools and objects correctly if (!is_string($value)) { // show bools and objects correctly
$value = json_encode($value); $value = json_encode($value);
} }
@ -106,7 +110,11 @@ class Config extends Base {
if (!is_null($decoded)) { if (!is_null($decoded)) {
$value = $decoded; $value = $decoded;
} }
$mount->setBackendOption($key, $value); if ($key === 'mountpoint' || $key === 'mount_point') {
$mount->setMountPoint($value);
} else {
$mount->setBackendOption($key, $value);
}
$this->globalService->updateStorage($mount); $this->globalService->updateStorage($mount);
} }
} }