From 8d95c0d01335f1be5e7ffe67deabe274cf478aa1 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 26 Mar 2014 11:29:04 +0100 Subject: [PATCH] Pretty print mount.json when possible --- apps/files_external/lib/config.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index ffbab7bca8..c5b091336e 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); }