summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-26 13:34:31 +0100
committerVincent Petry <pvince81@owncloud.com>2014-03-26 13:34:31 +0100
commit028973cbea865075a32db6228b56b7d3960771d6 (patch)
tree076a298f63c2799fce03ab7d77460c1487bc5d63
parent75d8de378cd355671c310bcb62c35504a5c03f0a (diff)
parent8d95c0d01335f1be5e7ffe67deabe274cf478aa1 (diff)
downloadnextcloud-server-028973cbea865075a32db6228b56b7d3960771d6.tar.gz
nextcloud-server-028973cbea865075a32db6228b56b7d3960771d6.zip
Merge pull request #7885 from owncloud/extstorage-prettyprintjson
Pretty print mount.json when possible
-rwxr-xr-xapps/files_external/lib/config.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index ffbab7bca80..c5b091336e1 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -538,7 +538,12 @@ class OC_Mount_Config {
$datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/');
$file = \OC_Config::getValue('mount_file', $datadir . '/mount.json');
}
- $content = json_encode($data);
+ $options = 0;
+ if (defined('JSON_PRETTY_PRINT')) {
+ // only for PHP >= 5.4
+ $options = JSON_PRETTY_PRINT;
+ }
+ $content = json_encode($data, $options);
@file_put_contents($file, $content);
@chmod($file, 0640);
}