2019-02-10 19:52:21 +01:00
|
|
|
<?php
|
2020-02-09 15:45:36 +01:00
|
|
|
/**
|
2022-01-02 08:27:47 +01:00
|
|
|
* @copyright Copyright (C) 2010-2022, the Friendica project
|
2020-02-09 15:45:36 +01:00
|
|
|
*
|
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
2019-02-10 19:52:21 +01:00
|
|
|
|
2021-10-23 11:29:16 +02:00
|
|
|
namespace Friendica\Core\Config\Type;
|
2019-02-10 19:52:21 +01:00
|
|
|
|
2021-10-26 21:44:29 +02:00
|
|
|
use Friendica\Core\Config\Repository\Config;
|
|
|
|
use Friendica\Core\Config\ValueObject\Cache;
|
|
|
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
2019-07-03 00:42:47 +02:00
|
|
|
|
2019-02-10 19:52:21 +01:00
|
|
|
/**
|
|
|
|
* This class is responsible for all system-wide configuration values in Friendica
|
|
|
|
* There are two types of storage
|
2021-10-26 21:44:29 +02:00
|
|
|
* - The Config-Files (loaded into the FileCache @see Cache)
|
|
|
|
* - The Config-Repository (per Config-Repository @see Config )
|
2019-02-10 19:52:21 +01:00
|
|
|
*/
|
2021-10-26 21:44:29 +02:00
|
|
|
abstract class AbstractConfig implements IManageConfigValues
|
2019-02-10 19:52:21 +01:00
|
|
|
{
|
|
|
|
/**
|
2020-01-19 22:23:44 +01:00
|
|
|
* @var Cache
|
2019-02-10 19:52:21 +01:00
|
|
|
*/
|
2019-07-03 00:42:47 +02:00
|
|
|
protected $configCache;
|
2019-02-10 19:52:21 +01:00
|
|
|
|
|
|
|
/**
|
2021-10-26 21:44:29 +02:00
|
|
|
* @var Config
|
2019-02-10 19:52:21 +01:00
|
|
|
*/
|
2021-10-26 21:44:29 +02:00
|
|
|
protected $configRepo;
|
2019-02-10 19:52:21 +01:00
|
|
|
|
|
|
|
/**
|
2021-10-26 21:44:29 +02:00
|
|
|
* @param Cache $configCache The configuration cache (based on the config-files)
|
|
|
|
* @param Config $configRepo The configuration repository
|
2019-02-10 19:52:21 +01:00
|
|
|
*/
|
2021-10-26 21:44:29 +02:00
|
|
|
public function __construct(Cache $configCache, Config $configRepo)
|
2019-02-10 19:52:21 +01:00
|
|
|
{
|
|
|
|
$this->configCache = $configCache;
|
2021-10-26 21:44:29 +02:00
|
|
|
$this->configRepo = $configRepo;
|
2019-02-10 19:52:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-12-19 20:11:07 +01:00
|
|
|
* {@inheritDoc}
|
2019-02-10 19:52:21 +01:00
|
|
|
*/
|
2021-10-26 21:44:29 +02:00
|
|
|
public function getCache(): Cache
|
2019-02-10 19:52:21 +01:00
|
|
|
{
|
|
|
|
return $this->configCache;
|
|
|
|
}
|
|
|
|
}
|