2019-02-10 18:52:21 +00:00
|
|
|
<?php
|
2020-02-09 14:45:36 +00:00
|
|
|
/**
|
2021-03-29 06:40:20 +00:00
|
|
|
* @copyright Copyright (C) 2010-2021, the Friendica project
|
2020-02-09 14:45:36 +00: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 18:52:21 +00:00
|
|
|
|
2020-01-19 20:29:36 +00:00
|
|
|
namespace Friendica\Core;
|
2019-02-10 18:52:21 +00:00
|
|
|
|
2020-01-19 20:29:36 +00:00
|
|
|
use Friendica\Core\Config\Cache;
|
|
|
|
use Friendica\Core\Config\IConfig;
|
2019-07-02 22:42:47 +00:00
|
|
|
use Friendica\Model;
|
|
|
|
|
2019-02-10 18:52:21 +00:00
|
|
|
/**
|
|
|
|
* This class is responsible for all system-wide configuration values in Friendica
|
|
|
|
* There are two types of storage
|
2019-10-16 12:58:09 +00:00
|
|
|
* - The Config-Files (loaded into the FileCache @see Cache\ConfigCache)
|
|
|
|
* - The Config-DB-Table (per Config-DB-model @see Model\Config\Config)
|
2019-02-10 18:52:21 +00:00
|
|
|
*/
|
2020-01-19 20:29:36 +00:00
|
|
|
abstract class BaseConfig implements IConfig
|
2019-02-10 18:52:21 +00:00
|
|
|
{
|
|
|
|
/**
|
2020-01-19 21:23:44 +00:00
|
|
|
* @var Cache
|
2019-02-10 18:52:21 +00:00
|
|
|
*/
|
2019-07-02 22:42:47 +00:00
|
|
|
protected $configCache;
|
2019-02-10 18:52:21 +00:00
|
|
|
|
|
|
|
/**
|
2019-07-02 22:42:47 +00:00
|
|
|
* @var Model\Config\Config
|
2019-02-10 18:52:21 +00:00
|
|
|
*/
|
2019-07-02 22:42:47 +00:00
|
|
|
protected $configModel;
|
2019-02-10 18:52:21 +00:00
|
|
|
|
|
|
|
/**
|
2020-01-19 21:23:44 +00:00
|
|
|
* @param Cache $configCache The configuration cache (based on the config-files)
|
|
|
|
* @param Model\Config\Config $configModel The configuration model
|
2019-02-10 18:52:21 +00:00
|
|
|
*/
|
2020-01-19 21:23:44 +00:00
|
|
|
public function __construct(Cache $configCache, Model\Config\Config $configModel)
|
2019-02-10 18:52:21 +00:00
|
|
|
{
|
|
|
|
$this->configCache = $configCache;
|
2019-07-02 22:42:47 +00:00
|
|
|
$this->configModel = $configModel;
|
2019-02-10 18:52:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-12-19 19:11:07 +00:00
|
|
|
* {@inheritDoc}
|
2019-02-10 18:52:21 +00:00
|
|
|
*/
|
|
|
|
public function getCache()
|
|
|
|
{
|
|
|
|
return $this->configCache;
|
|
|
|
}
|
|
|
|
}
|