From e5bc9d06195f95940fda5b600560c11dcd720636 Mon Sep 17 00:00:00 2001
From: Joas Schilling <nickvergessen@owncloud.com>
Date: Tue, 7 Jul 2015 11:25:29 +0200
Subject: [PATCH] Make it possible to import exportet app/system configs

---
 core/command/config/listconfigs.php           | 10 +++++++--
 tests/core/command/config/listconfigstest.php | 22 ++++++++++++++-----
 2 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/core/command/config/listconfigs.php b/core/command/config/listconfigs.php
index c139a40e269..c93d26cbda4 100644
--- a/core/command/config/listconfigs.php
+++ b/core/command/config/listconfigs.php
@@ -88,7 +88,9 @@ class ListConfigs extends Base {
 
 		switch ($app) {
 			case 'system':
-				$configs = $this->getSystemConfigs($noSensitiveValues);
+				$configs = [
+					'system' => $this->getSystemConfigs($noSensitiveValues),
+				];
 			break;
 
 			case 'all':
@@ -103,7 +105,11 @@ class ListConfigs extends Base {
 			break;
 
 			default:
-				$configs = $this->appConfig->getValues($app, false);
+				$configs = [
+					'apps' => [
+						$app => $this->appConfig->getValues($app, false),
+					],
+				];
 		}
 
 		$this->writeArrayInOutputFormat($input, $output, $configs);
diff --git a/tests/core/command/config/listconfigstest.php b/tests/core/command/config/listconfigstest.php
index b7021384df9..06c0f08873f 100644
--- a/tests/core/command/config/listconfigstest.php
+++ b/tests/core/command/config/listconfigstest.php
@@ -151,7 +151,9 @@ class ListConfigsTest extends TestCase {
 				],
 				true,
 				json_encode([
-					'overwrite.cli.url' => 'http://localhost',
+					'system' => [
+						'overwrite.cli.url' => 'http://localhost',
+					],
 				]),
 			],
 			[
@@ -176,8 +178,10 @@ class ListConfigsTest extends TestCase {
 				],
 				false,
 				json_encode([
-					'secret' => 'my secret',
-					'overwrite.cli.url' => 'http://localhost',
+					'system' => [
+						'secret' => 'my secret',
+						'overwrite.cli.url' => 'http://localhost',
+					],
 				]),
 			],
 			[
@@ -202,7 +206,11 @@ class ListConfigsTest extends TestCase {
 				],
 				true,
 				json_encode([
-					'enabled' => 'yes',
+					'apps' => [
+						'files' => [
+							'enabled' => 'yes',
+						],
+					],
 				]),
 			],
 			[
@@ -227,7 +235,11 @@ class ListConfigsTest extends TestCase {
 				],
 				false,
 				json_encode([
-					'enabled' => 'yes',
+					'apps' => [
+						'files' => [
+							'enabled' => 'yes',
+						],
+					],
 				]),
 			],
 		];
-- 
GitLab