Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Config.php « src - github.com/nextcloud/updater_server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c461c27f2e57e1d988c74177afe08112a13b84ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
 * @license MIT <http://opensource.org/licenses/MIT>
 */

namespace UpdateServer;

class Config {
	/** @var array */
	private $configArray = [];

	/**
	 * @param string $configFile
	 */
	public function __construct($configFile) {
		$this->configArray = require_once $configFile;
	}

	/**
	 * @param string $key
	 * @return mixed
	 */
	public function get($key) {
		return $this->configArray[$key];
	}

	/**
	 * @param string $key
	 * @param string $alternativeKey
	 * @return mixed
	 */
	public function getWithAlternative($key, $alternativeKey) {
		return $this->configArray[$key] ?? $this->configArray[$alternativeKey];
	}
}