for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Nextcloud - OCR
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
* @author Janis Koehr <[email protected]>
* @copyright Janis Koehr 2017
*/
namespace OCA\Ocr\Config;
use \OCP\IConfig;
class AppConfig{
private $appName = 'ocr';
private $defaults = [
'languages' => 'eng;fra;spa;deu'
];
private $config;
public function __construct(IConfig $config) {
$this->config = $config;
}
* Get a value by key
* @param string $key
* @return string
public function getAppValue($key) {
$defaultValue = null;
if (array_key_exists($key, $this->defaults)){
$defaultValue = $this->defaults[$key];
return $this->config->getAppValue($this->appName, $key, $defaultValue);
* Set a value by key
* @param string $value
public function setAppValue($key, $value) {
return $this->config->setAppValue($this->appName, $key, $value);