123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- declare(strict_types=1);
- namespace OC\AppFramework\Services;
- use OCP\AppFramework\Services\IAppConfig;
- use OCP\IConfig;
- class AppConfig implements IAppConfig {
-
- private $config;
-
- private $appName;
- public function __construct(IConfig $config, string $appName) {
- $this->config = $config;
- $this->appName = $appName;
- }
- public function getAppKeys(): array {
- return $this->config->getAppKeys($this->appName);
- }
- public function setAppValue(string $key, string $value): void {
- $this->config->setAppValue($this->appName, $key, $value);
- }
- public function getAppValue(string $key, string $default = ''): string {
- return $this->config->getAppValue($this->appName, $key, $default);
- }
- public function deleteAppValue(string $key): void {
- $this->config->deleteAppValue($this->appName, $key);
- }
- public function deleteAppValues(): void {
- $this->config->deleteAppValues($this->appName);
- }
- public function setUserValue(string $userId, string $key, string $value, ?string $preCondition = null): void {
- $this->config->setUserValue($userId, $this->appName, $key, $value, $preCondition);
- }
- public function getUserValue(string $userId, string $key, string $default = ''): string {
- return $this->config->getUserValue($userId, $this->appName, $key, $default);
- }
- public function deleteUserValue(string $userId, string $key): void {
- $this->config->deleteUserValue($userId, $this->appName, $key);
- }
- }
|