Completed
Push — master ( 63676d...3faef6 )
by Lukas
28:10 queued 12:28
created

ConfigController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 3
dl 0
loc 6
rs 9.4285
c 1
b 0
f 0
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016, ownCloud, Inc.
4
 *
5
 * @author Joas Schilling <[email protected]>
6
 *
7
 * @license AGPL-3.0
8
 *
9
 * This code is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU Affero General Public License, version 3,
11
 * as published by the Free Software Foundation.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU Affero General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Affero General Public License, version 3,
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
20
 *
21
 */
22
23
namespace OCA\Testing\Controller;
24
25
use OCP\AppFramework\Http\DataResponse;
26
use OCP\AppFramework\OCSController;
27
use OCP\IConfig;
28
use OCP\IRequest;
29
30
class ConfigController extends OCSController {
31
32
	/** @var IConfig */
33
	private $config;
34
35
	/**
36
	 * @param string $appName
37
	 * @param IRequest $request
38
	 * @param IConfig $config
39
	 */
40
	public function __construct($appName,
41
								IRequest $request,
42
								IConfig $config) {
43
		parent::__construct($appName, $request);
44
		$this->config = $config;
45
	}
46
47
	/**
48
	 * @param string $appid
49
	 * @param string $configkey
50
	 * @param string $value
51
	 * @return DataResponse
52
	 */
53
	public function setAppValue($appid, $configkey, $value) {
54
		$this->config->setAppValue($appid, $configkey, $value);
55
		return new DataResponse();
56
	}
57
58
	/**
59
	 * @param string $appid
60
	 * @param string $configkey
61
	 * @return DataResponse
62
	 */
63
	public function deleteAppValue($appid, $configkey) {
64
		$this->config->deleteAppValue($appid, $configkey);
65
		return new DataResponse();
66
	}
67
}
68