Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
7 / 7 |
ConfigApiController | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
7 / 7 |
__construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
4 / 4 |
|||
get | |
100.00% |
1 / 1 |
2 | |
100.00% |
3 / 3 |
<?php | |
/** | |
* Gallery | |
* | |
* This file is licensed under the Affero General Public License version 3 or | |
* later. See the COPYING file. | |
* | |
* @author Olivier Paroz <galleryapps@oparoz.com> | |
* | |
* @copyright Olivier Paroz 2016 | |
*/ | |
namespace OCA\Gallery\Controller; | |
use OCP\IRequest; | |
use OCP\ILogger; | |
use OCP\AppFramework\ApiController; | |
use OCP\AppFramework\Http; | |
use OCA\Gallery\Service\ConfigService; | |
/** | |
* Class ConfigApiController | |
* | |
* @package OCA\Gallery\Controller | |
*/ | |
class ConfigApiController extends ApiController { | |
use Config; | |
use HttpError; | |
/** | |
* Constructor | |
* | |
* @param string $appName | |
* @param IRequest $request | |
* @param ConfigService $configService | |
* @param ILogger $logger | |
*/ | |
public function __construct( | |
$appName, | |
IRequest $request, | |
ConfigService $configService, | |
ILogger $logger | |
) { | |
parent::__construct($appName, $request); | |
$this->configService = $configService; | |
$this->logger = $logger; | |
} | |
/** | |
* @NoAdminRequired | |
* @NoCSRFRequired | |
* @CORS | |
* | |
* Returns an app configuration array | |
* | |
* @param bool $extramediatypes | |
* | |
* @return array <string,null|array> | |
*/ | |
public function get($extramediatypes = false) { | |
try { | |
return $this->getConfig($extramediatypes); | |
} catch (\Exception $exception) { | |
return $this->jsonError($exception); | |
} | |
} | |
} |