aboutsummaryrefslogtreecommitdiffstats
path: root/apps/testing/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-07-22 12:48:22 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-07-24 13:43:00 +0200
commit10efec246de432e27a594d5b237bdef4d8e465eb (patch)
treebe81a405baa70fa65854bd6bffe520372f94e90b /apps/testing/lib
parentd1993c32e5ef84af2ac30b7b89a5b491e113f455 (diff)
downloadnextcloud-server-10efec246de432e27a594d5b237bdef4d8e465eb.tar.gz
nextcloud-server-10efec246de432e27a594d5b237bdef4d8e465eb.zip
Move over Config
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/testing/lib')
-rw-r--r--apps/testing/lib/Controller/ConfigController.php (renamed from apps/testing/lib/Config.php)50
1 files changed, 23 insertions, 27 deletions
diff --git a/apps/testing/lib/Config.php b/apps/testing/lib/Controller/ConfigController.php
index 6cdd28d4b3e..7b3e73ab173 100644
--- a/apps/testing/lib/Config.php
+++ b/apps/testing/lib/Controller/ConfigController.php
@@ -20,52 +20,48 @@
*
*/
-namespace OCA\Testing;
+namespace OCA\Testing\Controller;
+use OCP\AppFramework\Http\DataResponse;
+use OCP\AppFramework\OCSController;
use OCP\IConfig;
use OCP\IRequest;
-class Config {
+class ConfigController extends OCSController {
/** @var IConfig */
private $config;
- /** @var IRequest */
- private $request;
-
/**
- * @param IConfig $config
+ * @param string $appName
* @param IRequest $request
+ * @param IConfig $config
*/
- public function __construct(IConfig $config, IRequest $request) {
+ public function __construct($appName,
+ IRequest $request,
+ IConfig $config) {
+ parent::__construct($appName, $request);
$this->config = $config;
- $this->request = $request;
}
/**
- * @param array $parameters
- * @return \OC_OCS_Result
+ * @param string $appid
+ * @param string $configkey
+ * @param string $value
+ * @return DataResponse
*/
- public function setAppValue($parameters) {
- $app = $parameters['appid'];
- $configKey = $parameters['configkey'];
-
- $value = $this->request->getParam('value');
- $this->config->setAppValue($app, $configKey, $value);
-
- return new \OC_OCS_Result();
+ public function setAppValue($appid, $configkey, $value) {
+ $this->config->setAppValue($appid, $configkey, $value);
+ return new DataResponse();
}
/**
- * @param array $parameters
- * @return \OC_OCS_Result
+ * @param string $appid
+ * @param string $configkey
+ * @return DataResponse
*/
- public function deleteAppValue($parameters) {
- $app = $parameters['appid'];
- $configKey = $parameters['configkey'];
-
- $this->config->deleteAppValue($app, $configKey);
-
- return new \OC_OCS_Result();
+ public function deleteAppValue($appid, $configkey) {
+ $this->config->deleteAppValue($appid, $configkey);
+ return new DataResponse();
}
}