3) Introducing ConfigFactory
This commit is contained in:
parent
5c50684b50
commit
4af0119b73
23 changed files with 843 additions and 632 deletions
|
@ -15,11 +15,11 @@ use Friendica\Core\Config;
|
|||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\StorageManager;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Theme;
|
||||
use Friendica\Core\Update;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Core\StorageManager;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Database\DBStructure;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -30,6 +30,7 @@ use Friendica\Module;
|
|||
use Friendica\Module\Login;
|
||||
use Friendica\Module\Tos;
|
||||
use Friendica\Util\Arrays;
|
||||
use Friendica\Util\BasePath;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Strings;
|
||||
|
@ -1375,7 +1376,7 @@ function admin_page_site_post(App $a)
|
|||
Config::set('system', 'dbclean-expire-unclaimed', $dbclean_unclaimed);
|
||||
|
||||
if ($itemcache != '') {
|
||||
$itemcache = App::getRealPath($itemcache);
|
||||
$itemcache = BasePath::getRealPath($itemcache);
|
||||
}
|
||||
|
||||
Config::set('system', 'itemcache', $itemcache);
|
||||
|
@ -1383,13 +1384,13 @@ function admin_page_site_post(App $a)
|
|||
Config::set('system', 'max_comments', $max_comments);
|
||||
|
||||
if ($temppath != '') {
|
||||
$temppath = App::getRealPath($temppath);
|
||||
$temppath = BasePath::getRealPath($temppath);
|
||||
}
|
||||
|
||||
Config::set('system', 'temppath', $temppath);
|
||||
|
||||
if ($basepath != '') {
|
||||
$basepath = App::getRealPath($basepath);
|
||||
$basepath = BasePath::getRealPath($basepath);
|
||||
}
|
||||
|
||||
Config::set('system', 'basepath' , $basepath);
|
||||
|
|
|
@ -12,7 +12,7 @@ use Friendica\Core\System;
|
|||
use Friendica\Database\DBA;
|
||||
use Friendica\Module\Register;
|
||||
|
||||
function friendica_init(App $a)
|
||||
function friendica_init(App $a, Config\ConfigCache $config)
|
||||
{
|
||||
if (!empty($a->argv[1]) && ($a->argv[1] == "json")) {
|
||||
$register_policies = [
|
||||
|
@ -29,7 +29,7 @@ function friendica_init(App $a)
|
|||
}
|
||||
|
||||
$sql_extra = '';
|
||||
if (Config::getConfigValue('config', 'admin_nickname') !== null) {
|
||||
if ($config->get('config', 'admin_nickname') !== null) {
|
||||
$sql_extra = sprintf(" AND `nickname` = '%s' ", DBA::escape(Config::get('config', 'admin_nickname')));
|
||||
}
|
||||
if (!empty(Config::get('config', 'admin_email'))) {
|
||||
|
@ -48,7 +48,7 @@ function friendica_init(App $a)
|
|||
|
||||
Config::load('feature_lock');
|
||||
$locked_features = [];
|
||||
$featureLock = Config::getConfigValue('config', 'feature_lock');
|
||||
$featureLock = $config->get('config', 'feature_lock');
|
||||
if (isset($featureLock)) {
|
||||
foreach ($featureLock as $k => $v) {
|
||||
if ($k === 'config_loaded') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue