Move Config::get() to DI::config()->get()

This commit is contained in:
nupplaPhil 2020-01-19 21:21:13 +01:00
parent 5d294e8be8
commit 6c36fd9e01
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
126 changed files with 581 additions and 596 deletions

View file

@ -46,7 +46,7 @@ if (DI::mode()->isInstall()) {
DI::config()->load(); DI::config()->load();
if (empty(Config::get('system', 'pidfile'))) { if (empty(DI::config()->get('system', 'pidfile'))) {
die(<<<TXT die(<<<TXT
Please set system.pidfile in config/local.config.php. For example: Please set system.pidfile in config/local.config.php. For example:
@ -57,7 +57,7 @@ TXT
); );
} }
$pidfile = Config::get('system', 'pidfile'); $pidfile = DI::config()->get('system', 'pidfile');
if (in_array("start", $_SERVER["argv"])) { if (in_array("start", $_SERVER["argv"])) {
$mode = "start"; $mode = "start";
@ -158,7 +158,7 @@ Config::set('system', 'worker_daemon_mode', true);
// Just to be sure that this script really runs endlessly // Just to be sure that this script really runs endlessly
set_time_limit(0); set_time_limit(0);
$wait_interval = intval(Config::get('system', 'cron_interval', 5)) * 60; $wait_interval = intval(DI::config()->get('system', 'cron_interval', 5)) * 60;
$do_cron = true; $do_cron = true;
$last_cron = 0; $last_cron = 0;

View file

@ -46,7 +46,7 @@ if (!DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
return; return;
} }
DI::baseUrl()->saveByURL(Config::get('system', 'url')); DI::baseUrl()->saveByURL(DI::config()->get('system', 'url'));
$spawn = array_key_exists('s', $options) || array_key_exists('spawn', $options); $spawn = array_key_exists('s', $options) || array_key_exists('spawn', $options);

View file

@ -383,7 +383,7 @@ function is_site_admin()
{ {
$a = DI::app(); $a = DI::app();
$admin_email = Config::get('config', 'admin_email'); $admin_email = DI::config()->get('config', 'admin_email');
$adminlist = explode(',', str_replace(' ', '', $admin_email)); $adminlist = explode(',', str_replace(' ', '', $admin_email));
@ -446,7 +446,7 @@ function curPageURL()
function get_temppath() function get_temppath()
{ {
$temppath = Config::get("system", "temppath"); $temppath = DI::config()->get("system", "temppath");
if (($temppath != "") && System::isDirectoryUsable($temppath)) { if (($temppath != "") && System::isDirectoryUsable($temppath)) {
// We have a temp path and it is usable // We have a temp path and it is usable
@ -520,7 +520,7 @@ function clear_cache($basepath = "", $path = "")
return; return;
} }
$cachetime = (int) Config::get('system', 'itemcache_duration'); $cachetime = (int) DI::config()->get('system', 'itemcache_duration');
if ($cachetime == 0) { if ($cachetime == 0) {
$cachetime = 86400; $cachetime = 86400;
} }
@ -544,12 +544,12 @@ function clear_cache($basepath = "", $path = "")
function get_itemcachepath() function get_itemcachepath()
{ {
// Checking, if the cache is deactivated // Checking, if the cache is deactivated
$cachetime = (int) Config::get('system', 'itemcache_duration'); $cachetime = (int) DI::config()->get('system', 'itemcache_duration');
if ($cachetime < 0) { if ($cachetime < 0) {
return ""; return "";
} }
$itemcache = Config::get('system', 'itemcache'); $itemcache = DI::config()->get('system', 'itemcache');
if (($itemcache != "") && System::isDirectoryUsable($itemcache)) { if (($itemcache != "") && System::isDirectoryUsable($itemcache)) {
return BasePath::getRealPath($itemcache); return BasePath::getRealPath($itemcache);
} }
@ -577,7 +577,7 @@ function get_itemcachepath()
*/ */
function get_spoolpath() function get_spoolpath()
{ {
$spoolpath = Config::get('system', 'spoolpath'); $spoolpath = DI::config()->get('system', 'spoolpath');
if (($spoolpath != "") && System::isDirectoryUsable($spoolpath)) { if (($spoolpath != "") && System::isDirectoryUsable($spoolpath)) {
// We have a spool path and it is usable // We have a spool path and it is usable
return $spoolpath; return $spoolpath;

View file

@ -139,7 +139,7 @@ There you'll find somethink alike
$colorset = DI::pConfig()->get( local_user(), 'duepuntozero','colorset'); $colorset = DI::pConfig()->get( local_user(), 'duepuntozero','colorset');
if (!$colorset) if (!$colorset)
$colorset = Config::get('duepuntozero', 'colorset'); $colorset = DI::config()->get('duepuntozero', 'colorset');
if ($colorset) { if ($colorset) {
if ($colorset == 'greenzero') if ($colorset == 'greenzero')
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";

View file

@ -1096,7 +1096,7 @@ function api_statuses_update($type)
if (!$parent) { if (!$parent) {
// Check for throttling (maximum posts per day, week and month) // Check for throttling (maximum posts per day, week and month)
$throttle_day = Config::get('system', 'throttle_limit_day'); $throttle_day = DI::config()->get('system', 'throttle_limit_day');
if ($throttle_day > 0) { if ($throttle_day > 0) {
$datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60); $datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60);
@ -1110,7 +1110,7 @@ function api_statuses_update($type)
} }
} }
$throttle_week = Config::get('system', 'throttle_limit_week'); $throttle_week = DI::config()->get('system', 'throttle_limit_week');
if ($throttle_week > 0) { if ($throttle_week > 0) {
$datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60*7); $datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60*7);
@ -1124,7 +1124,7 @@ function api_statuses_update($type)
} }
} }
$throttle_month = Config::get('system', 'throttle_limit_month'); $throttle_month = DI::config()->get('system', 'throttle_limit_month');
if ($throttle_month > 0) { if ($throttle_month > 0) {
$datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60*30); $datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60*30);
@ -2739,7 +2739,7 @@ function api_get_entitities(&$text, $bbcode)
if ($image) { if ($image) {
// If image cache is activated, then use the following sizes: // If image cache is activated, then use the following sizes:
// thumb (150), small (340), medium (600) and large (1024) // thumb (150), small (340), medium (600) and large (1024)
if (!Config::get("system", "proxy_disabled")) { if (!DI::config()->get("system", "proxy_disabled")) {
$media_url = ProxyUtils::proxifyUrl($url); $media_url = ProxyUtils::proxifyUrl($url);
$sizes = []; $sizes = [];
@ -3572,15 +3572,15 @@ api_register_func('api/friendships/incoming', 'api_friendships_incoming', true);
*/ */
function api_statusnet_config($type) function api_statusnet_config($type)
{ {
$name = Config::get('config', 'sitename'); $name = DI::config()->get('config', 'sitename');
$server = DI::baseUrl()->getHostname(); $server = DI::baseUrl()->getHostname();
$logo = DI::baseUrl() . '/images/friendica-64.png'; $logo = DI::baseUrl() . '/images/friendica-64.png';
$email = Config::get('config', 'admin_email'); $email = DI::config()->get('config', 'admin_email');
$closed = intval(Config::get('config', 'register_policy')) === \Friendica\Module\Register::CLOSED ? 'true' : 'false'; $closed = intval(DI::config()->get('config', 'register_policy')) === \Friendica\Module\Register::CLOSED ? 'true' : 'false';
$private = Config::get('system', 'block_public') ? 'true' : 'false'; $private = DI::config()->get('system', 'block_public') ? 'true' : 'false';
$textlimit = (string) Config::get('config', 'api_import_size', Config::get('config', 'max_import_size', 200000)); $textlimit = (string) DI::config()->get('config', 'api_import_size', DI::config()->get('config', 'max_import_size', 200000));
$ssl = Config::get('system', 'have_ssl') ? 'true' : 'false'; $ssl = DI::config()->get('system', 'have_ssl') ? 'true' : 'false';
$sslserver = Config::get('system', 'have_ssl') ? str_replace('http:', 'https:', DI::baseUrl()) : ''; $sslserver = DI::config()->get('system', 'have_ssl') ? str_replace('http:', 'https:', DI::baseUrl()) : '';
$config = [ $config = [
'site' => ['name' => $name,'server' => $server, 'theme' => 'default', 'path' => '', 'site' => ['name' => $name,'server' => $server, 'theme' => 'default', 'path' => '',
@ -4627,7 +4627,7 @@ function api_account_update_profile_image($type)
// Update global directory in background // Update global directory in background
$url = DI::baseUrl() . '/profile/' . DI::app()->user['nickname']; $url = DI::baseUrl() . '/profile/' . DI::app()->user['nickname'];
if ($url && strlen(Config::get('system', 'directory'))) { if ($url && strlen(DI::config()->get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", $url); Worker::add(PRIORITY_LOW, "Directory", $url);
} }
@ -4684,7 +4684,7 @@ function api_account_update_profile($type)
Worker::add(PRIORITY_LOW, 'ProfileUpdate', $local_user); Worker::add(PRIORITY_LOW, 'ProfileUpdate', $local_user);
// Update global directory in background // Update global directory in background
if ($api_user['url'] && strlen(Config::get('system', 'directory'))) { if ($api_user['url'] && strlen(DI::config()->get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", $api_user['url']); Worker::add(PRIORITY_LOW, "Directory", $api_user['url']);
} }
@ -4792,7 +4792,7 @@ function save_media_to_database($mediatype, $media, $type, $album, $allow_cid, $
throw new InternalServerErrorException("image size exceeds PHP config settings, file was rejected by server"); throw new InternalServerErrorException("image size exceeds PHP config settings, file was rejected by server");
} }
// check against max upload size within Friendica instance // check against max upload size within Friendica instance
$maximagesize = Config::get('system', 'maximagesize'); $maximagesize = DI::config()->get('system', 'maximagesize');
if ($maximagesize && ($filesize > $maximagesize)) { if ($maximagesize && ($filesize > $maximagesize)) {
$formattedBytes = Strings::formatBytes($maximagesize); $formattedBytes = Strings::formatBytes($maximagesize);
throw new InternalServerErrorException("image size exceeds Friendica config setting (uploaded size: $formattedBytes)"); throw new InternalServerErrorException("image size exceeds Friendica config setting (uploaded size: $formattedBytes)");
@ -4810,7 +4810,7 @@ function save_media_to_database($mediatype, $media, $type, $album, $allow_cid, $
@unlink($src); @unlink($src);
// check max length of images on server // check max length of images on server
$max_length = Config::get('system', 'max_image_length'); $max_length = DI::config()->get('system', 'max_image_length');
if (!$max_length) { if (!$max_length) {
$max_length = MAX_IMAGE_LENGTH; $max_length = MAX_IMAGE_LENGTH;
} }
@ -6119,7 +6119,7 @@ function api_friendica_profile_show($type)
// retrieve general information about profiles for user // retrieve general information about profiles for user
$multi_profiles = Feature::isEnabled(api_user(), 'multi_profiles'); $multi_profiles = Feature::isEnabled(api_user(), 'multi_profiles');
$directory = Config::get('system', 'directory'); $directory = DI::config()->get('system', 'directory');
// get data of the specified profile id or all profiles of the user if not specified // get data of the specified profile id or all profiles of the user if not specified
if ($profile_id != 0) { if ($profile_id != 0) {

View file

@ -850,7 +850,7 @@ function conversation_fetch_comments($thread_items, $pinned) {
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
function conversation_add_children(array $parents, $block_authors, $order, $uid) { function conversation_add_children(array $parents, $block_authors, $order, $uid) {
$max_comments = Config::get('system', 'max_comments', 100); $max_comments = DI::config()->get('system', 'max_comments', 100);
$params = ['order' => ['uid', 'commented' => true]]; $params = ['order' => ['uid', 'commented' => true]];

View file

@ -60,9 +60,9 @@ function notification($params)
$product = FRIENDICA_PLATFORM; $product = FRIENDICA_PLATFORM;
$siteurl = DI::baseUrl()->get(true); $siteurl = DI::baseUrl()->get(true);
$thanks = $l10n->t('Thank You,'); $thanks = $l10n->t('Thank You,');
$sitename = Config::get('config', 'sitename'); $sitename = DI::config()->get('config', 'sitename');
if (Config::get('config', 'admin_name')) { if (DI::config()->get('config', 'admin_name')) {
$site_admin = $l10n->t('%1$s, %2$s Administrator', Config::get('config', 'admin_name'), $sitename); $site_admin = $l10n->t('%1$s, %2$s Administrator', DI::config()->get('config', 'admin_name'), $sitename);
} else { } else {
$site_admin = $l10n->t('%s Administrator', $sitename); $site_admin = $l10n->t('%s Administrator', $sitename);
} }
@ -587,7 +587,7 @@ function notification($params)
// check whether sending post content in email notifications is allowed // check whether sending post content in email notifications is allowed
// always true for SYSTEM_EMAIL // always true for SYSTEM_EMAIL
$content_allowed = ((!Config::get('system', 'enotify_no_content')) || ($params['type'] == SYSTEM_EMAIL)); $content_allowed = ((!DI::config()->get('system', 'enotify_no_content')) || ($params['type'] == SYSTEM_EMAIL));
// load the template for private message notifications // load the template for private message notifications
$tpl = Renderer::getMarkupTemplate('email_notify_html.tpl'); $tpl = Renderer::getMarkupTemplate('email_notify_html.tpl');

View file

@ -73,7 +73,7 @@ function add_page_info_data(array $data, $no_photos = false)
$preview = str_replace(["[", "]"], ["&#91;", "&#93;"], htmlentities($data["images"][0]["src"], ENT_QUOTES, 'UTF-8', false)); $preview = str_replace(["[", "]"], ["&#91;", "&#93;"], htmlentities($data["images"][0]["src"], ENT_QUOTES, 'UTF-8', false));
// if the preview picture is larger than 500 pixels then show it in a larger mode // if the preview picture is larger than 500 pixels then show it in a larger mode
// But only, if the picture isn't higher than large (To prevent huge posts) // But only, if the picture isn't higher than large (To prevent huge posts)
if (!Config::get('system', 'always_show_preview') && ($data["images"][0]["width"] >= 500) if (!DI::config()->get('system', 'always_show_preview') && ($data["images"][0]["width"] >= 500)
&& ($data["images"][0]["width"] >= $data["images"][0]["height"])) { && ($data["images"][0]["width"] >= $data["images"][0]["height"])) {
$text .= " image='".$preview."'"; $text .= " image='".$preview."'";
} else { } else {

View file

@ -25,7 +25,7 @@ use Friendica\Util\Temporal;
function cal_init(App $a) function cal_init(App $a)
{ {
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.')); throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
} }
@ -237,7 +237,7 @@ function cal_content(App $a)
if (!empty($_GET['id'])) { if (!empty($_GET['id'])) {
$tpl = Renderer::getMarkupTemplate("event.tpl"); $tpl = Renderer::getMarkupTemplate("event.tpl");
} else { } else {
// if (Config::get('experimentals','new_calendar')==1){ // if (DI::config()->get('experimentals','new_calendar')==1){
$tpl = Renderer::getMarkupTemplate("events_js.tpl"); $tpl = Renderer::getMarkupTemplate("events_js.tpl");
// } else { // } else {
// $tpl = Renderer::getMarkupTemplate("events.tpl"); // $tpl = Renderer::getMarkupTemplate("events.tpl");

View file

@ -21,12 +21,12 @@ function community_content(App $a, $update = 0)
{ {
$o = ''; $o = '';
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
notice(DI::l10n()->t('Public access denied.') . EOL); notice(DI::l10n()->t('Public access denied.') . EOL);
return; return;
} }
$page_style = Config::get('system', 'community_page_style'); $page_style = DI::config()->get('system', 'community_page_style');
if ($page_style == CP_NO_INTERNAL_COMMUNITY) { if ($page_style == CP_NO_INTERNAL_COMMUNITY) {
notice(DI::l10n()->t('Access denied.') . EOL); notice(DI::l10n()->t('Access denied.') . EOL);
@ -55,7 +55,7 @@ function community_content(App $a, $update = 0)
if ($a->argc > 1) { if ($a->argc > 1) {
$content = $a->argv[1]; $content = $a->argv[1];
} else { } else {
if (!empty(Config::get('system', 'singleuser'))) { if (!empty(DI::config()->get('system', 'singleuser'))) {
// On single user systems only the global page does make sense // On single user systems only the global page does make sense
$content = 'global'; $content = 'global';
} else { } else {
@ -90,7 +90,7 @@ function community_content(App $a, $update = 0)
if (!$update) { if (!$update) {
$tabs = []; $tabs = [];
if ((local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(Config::get('system', 'singleuser'))) { if ((local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(DI::config()->get('system', 'singleuser'))) {
$tabs[] = [ $tabs[] = [
'label' => DI::l10n()->t('Local Community'), 'label' => DI::l10n()->t('Local Community'),
'url' => 'community/local', 'url' => 'community/local',
@ -156,7 +156,7 @@ function community_content(App $a, $update = 0)
return $o; return $o;
} }
$maxpostperauthor = (int) Config::get('system', 'max_author_posts_community_page'); $maxpostperauthor = (int) DI::config()->get('system', 'max_author_posts_community_page');
if (($maxpostperauthor != 0) && ($content == 'local')) { if (($maxpostperauthor != 0) && ($content == 'local')) {
$count = 1; $count = 1;
@ -203,7 +203,7 @@ function community_content(App $a, $update = 0)
return Renderer::replaceMacros($t, [ return Renderer::replaceMacros($t, [
'$content' => $o, '$content' => $o,
'$header' => '', '$header' => '',
'$show_global_community_hint' => ($content == 'global') && Config::get('system', 'show_global_community_hint'), '$show_global_community_hint' => ($content == 'global') && DI::config()->get('system', 'show_global_community_hint'),
'$global_community_hint' => DI::l10n()->t("This community stream shows all public posts received by this node. They may not reflect the opinions of this nodes users.") '$global_community_hint' => DI::l10n()->t("This community stream shows all public posts received by this node. They may not reflect the opinions of this nodes users.")
]); ]);
} }

View file

@ -117,7 +117,7 @@ function crepair_content(App $a)
$returnaddr = "contact/$cid"; $returnaddr = "contact/$cid";
$allow_remote_self = Config::get('system', 'allow_users_remote_self'); $allow_remote_self = DI::config()->get('system', 'allow_users_remote_self');
// Disable remote self for everything except feeds. // Disable remote self for everything except feeds.
// There is an issue when you repeat an item from maybe twitter and you got comments from friendica and twitter // There is an issue when you repeat an item from maybe twitter and you got comments from friendica and twitter

View file

@ -229,7 +229,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
return; return;
} }
if (strlen($leading_junk) && Config::get('system', 'debugging')) { if (strlen($leading_junk) && DI::config()->get('system', 'debugging')) {
// This might be more common. Mixed error text and some XML. // This might be more common. Mixed error text and some XML.
// If we're configured for debugging, show the text. Proceed in either case. // If we're configured for debugging, show the text. Proceed in either case.
notice(DI::l10n()->t('Unexpected response from remote site: ') . EOL . $leading_junk . EOL); notice(DI::l10n()->t('Unexpected response from remote site: ') . EOL . $leading_junk . EOL);

View file

@ -128,7 +128,7 @@ function dfrn_notify_post(App $a) {
System::xmlExit(0, 'relationship dissolved'); System::xmlExit(0, 'relationship dissolved');
} }
$rino = Config::get('system', 'rino_encrypt'); $rino = DI::config()->get('system', 'rino_encrypt');
$rino = intval($rino); $rino = intval($rino);
if (strlen($key)) { if (strlen($key)) {
@ -343,7 +343,7 @@ function dfrn_notify_content(App $a) {
$encrypted_id = bin2hex($encrypted_id); $encrypted_id = bin2hex($encrypted_id);
$rino = Config::get('system', 'rino_encrypt'); $rino = DI::config()->get('system', 'rino_encrypt');
$rino = intval($rino); $rino = intval($rino);
Logger::log("Local rino version: ". $rino, Logger::DATA); Logger::log("Local rino version: ". $rino, Logger::DATA);

View file

@ -49,7 +49,7 @@ function dfrn_poll_init(App $a)
$hidewall = false; $hidewall = false;
if (($dfrn_id === '') && empty($_POST['dfrn_id'])) { if (($dfrn_id === '') && empty($_POST['dfrn_id'])) {
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
throw new \Friendica\Network\HTTPException\ForbiddenException(); throw new \Friendica\Network\HTTPException\ForbiddenException();
} }

View file

@ -595,8 +595,8 @@ function dfrn_request_content(App $a)
exit(); exit();
} else { } else {
// Normal web request. Display our user's introduction form. // Normal web request. Display our user's introduction form.
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
if (!Config::get('system', 'local_block')) { if (!DI::config()->get('system', 'local_block')) {
notice(DI::l10n()->t('Public access denied.') . EOL); notice(DI::l10n()->t('Public access denied.') . EOL);
return; return;
} }

View file

@ -30,7 +30,7 @@ function display_init(App $a)
Objects::rawContent(); Objects::rawContent();
} }
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
return; return;
} }
@ -164,7 +164,7 @@ function display_fetchauthor($a, $item)
function display_content(App $a, $update = false, $update_uid = 0) function display_content(App $a, $update = false, $update_uid = 0)
{ {
if (Config::get('system','block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system','block_public') && !Session::isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.')); throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
} }

View file

@ -94,14 +94,14 @@ function follow_content(App $a)
$protocol = Contact::getProtocol($ret['url'], $ret['network']); $protocol = Contact::getProtocol($ret['url'], $ret['network']);
if (($protocol == Protocol::DIASPORA) && !Config::get('system', 'diaspora_enabled')) { if (($protocol == Protocol::DIASPORA) && !DI::config()->get('system', 'diaspora_enabled')) {
notice(DI::l10n()->t("Diaspora support isn't enabled. Contact can't be added.")); notice(DI::l10n()->t("Diaspora support isn't enabled. Contact can't be added."));
$submit = ''; $submit = '';
//$a->internalRedirect($_SESSION['return_path']); //$a->internalRedirect($_SESSION['return_path']);
// NOTREACHED // NOTREACHED
} }
if (($protocol == Protocol::OSTATUS) && Config::get('system', 'ostatus_disabled')) { if (($protocol == Protocol::OSTATUS) && DI::config()->get('system', 'ostatus_disabled')) {
notice(DI::l10n()->t("OStatus support is disabled. Contact can't be added.")); notice(DI::l10n()->t("OStatus support is disabled. Contact can't be added."));
$submit = ''; $submit = '';
//$a->internalRedirect($_SESSION['return_path']); //$a->internalRedirect($_SESSION['return_path']);

View file

@ -315,7 +315,7 @@ function item_post(App $a) {
// if using the API, we won't see pubmail_enable - figure out if it should be set // if using the API, we won't see pubmail_enable - figure out if it should be set
if ($api_source && $profile_uid && $profile_uid == local_user() && !$private) { if ($api_source && $profile_uid && $profile_uid == local_user() && !$private) {
if (function_exists('imap_open') && !Config::get('system', 'imap_disabled')) { if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) {
$pubmail_enabled = DBA::exists('mailacct', ["`uid` = ? AND `server` != ? AND `pubmail`", local_user(), '']); $pubmail_enabled = DBA::exists('mailacct', ["`uid` = ? AND `server` != ? AND `pubmail`", local_user(), '']);
} }
} }
@ -1060,7 +1060,7 @@ function handle_tag(&$body, &$inform, &$str_tags, $profile_uid, $tag, $network =
function item_add_implicit_mentions(array $tags, array $thread_parent_contact, $thread_parent_id) function item_add_implicit_mentions(array $tags, array $thread_parent_contact, $thread_parent_id)
{ {
if (Config::get('system', 'disable_implicit_mentions')) { if (DI::config()->get('system', 'disable_implicit_mentions')) {
// Add a tag if the parent contact is from ActivityPub or OStatus (This will notify them) // Add a tag if the parent contact is from ActivityPub or OStatus (This will notify them)
if (in_array($thread_parent_contact['network'], [Protocol::OSTATUS, Protocol::ACTIVITYPUB])) { if (in_array($thread_parent_contact['network'], [Protocol::OSTATUS, Protocol::ACTIVITYPUB])) {
$contact = Term::TAG_CHARACTER[Term::MENTION] . '[url=' . $thread_parent_contact['url'] . ']' . $thread_parent_contact['nick'] . '[/url]'; $contact = Term::TAG_CHARACTER[Term::MENTION] . '[url=' . $thread_parent_contact['url'] . ']' . $thread_parent_contact['nick'] . '[/url]';

View file

@ -38,7 +38,7 @@ function lostpass_post(App $a)
info(DI::l10n()->t('Password reset request issued. Check your email.') . EOL); info(DI::l10n()->t('Password reset request issued. Check your email.') . EOL);
} }
$sitename = Config::get('config', 'sitename'); $sitename = DI::config()->get('config', 'sitename');
$resetlink = DI::baseUrl() . '/lostpass/' . $pwdreset_token; $resetlink = DI::baseUrl() . '/lostpass/' . $pwdreset_token;
$preamble = Strings::deindent(DI::l10n()->t(' $preamble = Strings::deindent(DI::l10n()->t('
@ -143,7 +143,7 @@ function lostpass_generate_password($user)
info("Your password has been reset." . EOL); info("Your password has been reset." . EOL);
$sitename = Config::get('config', 'sitename'); $sitename = DI::config()->get('config', 'sitename');
$preamble = Strings::deindent(DI::l10n()->t(' $preamble = Strings::deindent(DI::l10n()->t('
Dear %1$s, Dear %1$s,
Your password has been changed as requested. Please retain this Your password has been changed as requested. Please retain this

View file

@ -55,7 +55,7 @@ function match_content(App $a)
$params['s'] = $tags; $params['s'] = $tags;
$params['n'] = 100; $params['n'] = 100;
if (strlen(Config::get('system', 'directory'))) { if (strlen(DI::config()->get('system', 'directory'))) {
$host = Search::getGlobalDirectory(); $host = Search::getGlobalDirectory();
} else { } else {
$host = DI::baseUrl(); $host = DI::baseUrl();

View file

@ -357,7 +357,7 @@ function networkFlatView(App $a, $update = 0)
$o .= status_editor($a, $x); $o .= status_editor($a, $x);
if (!Config::get('theme', 'hide_eventlist')) { if (!DI::config()->get('theme', 'hide_eventlist')) {
$o .= Profile::getBirthdays(); $o .= Profile::getBirthdays();
$o .= Profile::getEventsReminderHTML(); $o .= Profile::getEventsReminderHTML();
} }
@ -620,7 +620,7 @@ function networkThreadedView(App $a, $update, $parent)
} }
} }
if (!$gid && !$cid && !$update && !Config::get('theme', 'hide_eventlist')) { if (!$gid && !$cid && !$update && !DI::config()->get('theme', 'hide_eventlist')) {
$o .= Profile::getBirthdays(); $o .= Profile::getBirthdays();
$o .= Profile::getEventsReminderHTML(); $o .= Profile::getEventsReminderHTML();
} }
@ -703,7 +703,7 @@ function networkThreadedView(App $a, $update, $parent)
} else { } else {
// Load all unseen items // Load all unseen items
$sql_extra4 = "`item`.`unseen`"; $sql_extra4 = "`item`.`unseen`";
if (Config::get("system", "like_no_comment")) { if (DI::config()->get("system", "like_no_comment")) {
$sql_extra4 .= " AND `item`.`gravity` IN (" . GRAVITY_PARENT . "," . GRAVITY_COMMENT . ")"; $sql_extra4 .= " AND `item`.`gravity` IN (" . GRAVITY_PARENT . "," . GRAVITY_COMMENT . ")";
} }
if ($order === 'post') { if ($order === 'post') {

View file

@ -36,7 +36,7 @@ use Friendica\Util\XML;
function photos_init(App $a) { function photos_init(App $a) {
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
return; return;
} }
@ -696,7 +696,7 @@ function photos_post(App $a)
Logger::log('photos: upload: received file: ' . $filename . ' as ' . $src . ' ('. $type . ') ' . $filesize . ' bytes', Logger::DEBUG); Logger::log('photos: upload: received file: ' . $filename . ' as ' . $src . ' ('. $type . ') ' . $filesize . ' bytes', Logger::DEBUG);
$maximagesize = Config::get('system', 'maximagesize'); $maximagesize = DI::config()->get('system', 'maximagesize');
if ($maximagesize && ($filesize > $maximagesize)) { if ($maximagesize && ($filesize > $maximagesize)) {
notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL); notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL);
@ -732,7 +732,7 @@ function photos_post(App $a)
$exif = $image->orient($src); $exif = $image->orient($src);
@unlink($src); @unlink($src);
$max_length = Config::get('system', 'max_image_length'); $max_length = DI::config()->get('system', 'max_image_length');
if (!$max_length) { if (!$max_length) {
$max_length = MAX_IMAGE_LENGTH; $max_length = MAX_IMAGE_LENGTH;
} }
@ -833,7 +833,7 @@ function photos_content(App $a)
// photos/name/image/xxxxx/edit // photos/name/image/xxxxx/edit
// photos/name/image/xxxxx/drop // photos/name/image/xxxxx/drop
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
notice(DI::l10n()->t('Public access denied.') . EOL); notice(DI::l10n()->t('Public access denied.') . EOL);
return; return;
} }
@ -1157,7 +1157,7 @@ function photos_content(App $a)
* The query leads to a really intense used index. * The query leads to a really intense used index.
* By now we hide it if someone wants to. * By now we hide it if someone wants to.
*/ */
if ($cmd === 'view' && !Config::get('system', 'no_count', false)) { if ($cmd === 'view' && !DI::config()->get('system', 'no_count', false)) {
$order_field = $_GET['order'] ?? ''; $order_field = $_GET['order'] ?? '';
if ($order_field === 'posted') { if ($order_field === 'posted') {

View file

@ -186,7 +186,7 @@ function ping_init(App $a)
); );
$mail_count = count($mails); $mail_count = count($mails);
if (intval(Config::get('config', 'register_policy')) === \Friendica\Module\Register::APPROVE && is_site_admin()) { if (intval(DI::config()->get('config', 'register_policy')) === \Friendica\Module\Register::APPROVE && is_site_admin()) {
$regs = Friendica\Model\Register::getPending(); $regs = Friendica\Model\Register::getPending();
if (DBA::isResult($regs)) { if (DBA::isResult($regs)) {

View file

@ -20,7 +20,7 @@ use Friendica\Util\XML;
function poco_init(App $a) { function poco_init(App $a) {
$system_mode = false; $system_mode = false;
if (intval(Config::get('system', 'block_public')) || (Config::get('system', 'block_local_dir'))) { if (intval(DI::config()->get('system', 'block_public')) || (DI::config()->get('system', 'block_local_dir'))) {
throw new \Friendica\Network\HTTPException\ForbiddenException(); throw new \Friendica\Network\HTTPException\ForbiddenException();
} }

View file

@ -123,7 +123,7 @@ function profile_photo_post(App $a)
info(DI::l10n()->t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL); info(DI::l10n()->t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL);
// Update global directory in background // Update global directory in background
if ($path && strlen(Config::get('system', 'directory'))) { if ($path && strlen(DI::config()->get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", DI::baseUrl()->get() . '/' . $path); Worker::add(PRIORITY_LOW, "Directory", DI::baseUrl()->get() . '/' . $path);
} }
@ -145,7 +145,7 @@ function profile_photo_post(App $a)
$filetype = Image::guessType($filename); $filetype = Image::guessType($filename);
} }
$maximagesize = Config::get('system', 'maximagesize'); $maximagesize = DI::config()->get('system', 'maximagesize');
if (($maximagesize) && ($filesize > $maximagesize)) { if (($maximagesize) && ($filesize > $maximagesize)) {
notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL); notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL);
@ -217,7 +217,7 @@ function profile_photo_content(App $a)
// Update global directory in background // Update global directory in background
$url = $_SESSION['my_url']; $url = $_SESSION['my_url'];
if ($url && strlen(Config::get('system', 'directory'))) { if ($url && strlen(DI::config()->get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", $url); Worker::add(PRIORITY_LOW, "Directory", $url);
} }
@ -271,7 +271,7 @@ function profile_photo_content(App $a)
function profile_photo_crop_ui_head(Image $image) function profile_photo_crop_ui_head(Image $image)
{ {
$max_length = Config::get('system', 'max_image_length'); $max_length = DI::config()->get('system', 'max_image_length');
if (!$max_length) { if (!$max_length) {
$max_length = MAX_IMAGE_LENGTH; $max_length = MAX_IMAGE_LENGTH;
} }

View file

@ -479,7 +479,7 @@ function profiles_post(App $a) {
// Update global directory in background // Update global directory in background
$url = $_SESSION['my_url']; $url = $_SESSION['my_url'];
if ($url && strlen(Config::get('system', 'directory'))) { if ($url && strlen(DI::config()->get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", $url); Worker::add(PRIORITY_LOW, "Directory", $url);
} }

View file

@ -42,7 +42,7 @@ function profperm_content(App $a) {
$switchtotext = DI::pConfig()->get(local_user(),'system','groupedit_image_limit'); $switchtotext = DI::pConfig()->get(local_user(),'system','groupedit_image_limit');
if (is_null($switchtotext)) { if (is_null($switchtotext)) {
$switchtotext = Config::get('system','groupedit_image_limit', 400); $switchtotext = DI::config()->get('system','groupedit_image_limit', 400);
} }
if (($a->argc > 2) && intval($a->argv[1]) && intval($a->argv[2])) { if (($a->argc > 2) && intval($a->argv[1]) && intval($a->argv[2])) {

View file

@ -16,7 +16,7 @@ function post_var($name) {
function pubsubhubbub_init(App $a) { function pubsubhubbub_init(App $a) {
// PuSH subscription must be considered "public" so just block it // PuSH subscription must be considered "public" so just block it
// if public access isn't enabled. // if public access isn't enabled.
if (Config::get('system', 'block_public')) { if (DI::config()->get('system', 'block_public')) {
throw new \Friendica\Network\HTTPException\ForbiddenException(); throw new \Friendica\Network\HTTPException\ForbiddenException();
} }

View file

@ -30,7 +30,7 @@ function user_allow($hash)
$profile = DBA::selectFirst('profile', ['net-publish'], ['uid' => $register['uid'], 'is-default' => true]); $profile = DBA::selectFirst('profile', ['net-publish'], ['uid' => $register['uid'], 'is-default' => true]);
if (DBA::isResult($profile) && $profile['net-publish'] && Config::get('system', 'directory')) { if (DBA::isResult($profile) && $profile['net-publish'] && DI::config()->get('system', 'directory')) {
$url = DI::baseUrl() . '/profile/' . $user['nickname']; $url = DI::baseUrl() . '/profile/' . $user['nickname'];
Worker::add(PRIORITY_LOW, "Directory", $url); Worker::add(PRIORITY_LOW, "Directory", $url);
} }
@ -40,7 +40,7 @@ function user_allow($hash)
$res = User::sendRegisterOpenEmail( $res = User::sendRegisterOpenEmail(
$l10n, $l10n,
$user, $user,
Config::get('config', 'sitename'), DI::config()->get('config', 'sitename'),
DI::baseUrl()->get(), DI::baseUrl()->get(),
($register['password'] ?? '') ?: 'Sent in a previous email' ($register['password'] ?? '') ?: 'Sent in a previous email'
); );
@ -78,7 +78,7 @@ function regmod_content(App $a)
{ {
if (!local_user()) { if (!local_user()) {
info(DI::l10n()->t('Please login.') . EOL); info(DI::l10n()->t('Please login.') . EOL);
return Login::form(DI::args()->getQueryString(), intval(Config::get('config', 'register_policy')) === \Friendica\Module\Register::CLOSED ? 0 : 1); return Login::form(DI::args()->getQueryString(), intval(DI::config()->get('config', 'register_policy')) === \Friendica\Module\Register::CLOSED ? 0 : 1);
} }
if (!is_site_admin() || !empty($_SESSION['submanage'])) { if (!is_site_admin() || !empty($_SESSION['submanage'])) {

View file

@ -35,7 +35,7 @@ function removeme_post(App $a)
// send notification to admins so that they can clean um the backups // send notification to admins so that they can clean um the backups
// send email to admins // send email to admins
$admin_mails = explode(",", str_replace(" ", "", Config::get('config', 'admin_email'))); $admin_mails = explode(",", str_replace(" ", "", DI::config()->get('config', 'admin_email')));
foreach ($admin_mails as $mail) { foreach ($admin_mails as $mail) {
$admin = DBA::selectFirst('user', ['uid', 'language', 'email', 'username'], ['email' => $mail]); $admin = DBA::selectFirst('user', ['uid', 'language', 'email', 'username'], ['email' => $mail]);
if (!DBA::isResult($admin)) { if (!DBA::isResult($admin)) {

View file

@ -250,9 +250,9 @@ function settings_post(App $a)
$mail_pubmail = $_POST['mail_pubmail'] ?? ''; $mail_pubmail = $_POST['mail_pubmail'] ?? '';
if ( if (
!Config::get('system', 'dfrn_only') !DI::config()->get('system', 'dfrn_only')
&& function_exists('imap_open') && function_exists('imap_open')
&& !Config::get('system', 'imap_disabled') && !DI::config()->get('system', 'imap_disabled')
) { ) {
$failed = false; $failed = false;
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1", $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
@ -541,8 +541,8 @@ function settings_post(App $a)
$err .= DI::l10n()->t('Invalid email.'); $err .= DI::l10n()->t('Invalid email.');
} }
// ensure new email is not the admin mail // ensure new email is not the admin mail
if (Config::get('config', 'admin_email')) { if (DI::config()->get('config', 'admin_email')) {
$adminlist = explode(",", str_replace(" ", "", strtolower(Config::get('config', 'admin_email')))); $adminlist = explode(",", str_replace(" ", "", strtolower(DI::config()->get('config', 'admin_email'))));
if (in_array(strtolower($email), $adminlist)) { if (in_array(strtolower($email), $adminlist)) {
$err .= DI::l10n()->t('Cannot change to that email.'); $err .= DI::l10n()->t('Cannot change to that email.');
$email = $a->user['email']; $email = $a->user['email'];
@ -625,7 +625,7 @@ function settings_post(App $a)
if (($old_visibility != $net_publish) || ($page_flags != $old_page_flags)) { if (($old_visibility != $net_publish) || ($page_flags != $old_page_flags)) {
// Update global directory in background // Update global directory in background
$url = $_SESSION['my_url']; $url = $_SESSION['my_url'];
if ($url && strlen(Config::get('system', 'directory'))) { if ($url && strlen(DI::config()->get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", $url); Worker::add(PRIORITY_LOW, "Directory", $url);
} }
} }
@ -791,15 +791,15 @@ function settings_content(App $a)
Hook::callAll('connector_settings', $settings_connectors); Hook::callAll('connector_settings', $settings_connectors);
if (is_site_admin()) { if (is_site_admin()) {
$diasp_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('Diaspora'), ((Config::get('system', 'diaspora_enabled')) ? DI::l10n()->t('enabled') : DI::l10n()->t('disabled'))); $diasp_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('Diaspora'), ((DI::config()->get('system', 'diaspora_enabled')) ? DI::l10n()->t('enabled') : DI::l10n()->t('disabled')));
$ostat_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t("GNU Social \x28OStatus\x29"), ((Config::get('system', 'ostatus_disabled')) ? DI::l10n()->t('disabled') : DI::l10n()->t('enabled'))); $ostat_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t("GNU Social \x28OStatus\x29"), ((DI::config()->get('system', 'ostatus_disabled')) ? DI::l10n()->t('disabled') : DI::l10n()->t('enabled')));
} else { } else {
$diasp_enabled = ""; $diasp_enabled = "";
$ostat_enabled = ""; $ostat_enabled = "";
} }
$mail_disabled = ((function_exists('imap_open') && (!Config::get('system', 'imap_disabled'))) ? 0 : 1); $mail_disabled = ((function_exists('imap_open') && (!DI::config()->get('system', 'imap_disabled'))) ? 0 : 1);
if (Config::get('system', 'dfrn_only')) { if (DI::config()->get('system', 'dfrn_only')) {
$mail_disabled = 1; $mail_disabled = 1;
} }
if (!$mail_disabled) { if (!$mail_disabled) {
@ -827,7 +827,7 @@ function settings_content(App $a)
$ssl_options = ['TLS' => 'TLS', 'SSL' => 'SSL']; $ssl_options = ['TLS' => 'TLS', 'SSL' => 'SSL'];
if (Config::get('system', 'insecure_imap')) { if (DI::config()->get('system', 'insecure_imap')) {
$ssl_options['notls'] = DI::l10n()->t('None'); $ssl_options['notls'] = DI::l10n()->t('None');
} }
@ -877,11 +877,11 @@ function settings_content(App $a)
* DISPLAY SETTINGS * DISPLAY SETTINGS
*/ */
if (($a->argc > 1) && ($a->argv[1] === 'display')) { if (($a->argc > 1) && ($a->argv[1] === 'display')) {
$default_theme = Config::get('system', 'theme'); $default_theme = DI::config()->get('system', 'theme');
if (!$default_theme) { if (!$default_theme) {
$default_theme = 'default'; $default_theme = 'default';
} }
$default_mobile_theme = Config::get('system', 'mobile-theme'); $default_mobile_theme = DI::config()->get('system', 'mobile-theme');
if (!$default_mobile_theme) { if (!$default_mobile_theme) {
$default_mobile_theme = 'none'; $default_mobile_theme = 'none';
} }
@ -894,7 +894,7 @@ function settings_content(App $a)
$is_experimental = file_exists('view/theme/' . $theme . '/experimental'); $is_experimental = file_exists('view/theme/' . $theme . '/experimental');
$is_unsupported = file_exists('view/theme/' . $theme . '/unsupported'); $is_unsupported = file_exists('view/theme/' . $theme . '/unsupported');
$is_mobile = file_exists('view/theme/' . $theme . '/mobile'); $is_mobile = file_exists('view/theme/' . $theme . '/mobile');
if (!$is_experimental || ($is_experimental && (Config::get('experimentals', 'exp_themes')==1 || is_null(Config::get('experimentals', 'exp_themes'))))) { if (!$is_experimental || ($is_experimental && (DI::config()->get('experimentals', 'exp_themes')==1 || is_null(DI::config()->get('experimentals', 'exp_themes'))))) {
$theme_name = ucfirst($theme); $theme_name = ucfirst($theme);
if ($is_unsupported) { if ($is_unsupported) {
$theme_name = DI::l10n()->t('%s - (Unsupported)', $theme_name); $theme_name = DI::l10n()->t('%s - (Unsupported)', $theme_name);
@ -1068,7 +1068,7 @@ function settings_content(App $a)
]); ]);
$noid = Config::get('system', 'no_openid'); $noid = DI::config()->get('system', 'no_openid');
if ($noid) { if ($noid) {
$openid_field = false; $openid_field = false;
@ -1077,7 +1077,7 @@ function settings_content(App $a)
} }
$opt_tpl = Renderer::getMarkupTemplate("field_yesno.tpl"); $opt_tpl = Renderer::getMarkupTemplate("field_yesno.tpl");
if (Config::get('system', 'publish_all')) { if (DI::config()->get('system', 'publish_all')) {
$profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />'; $profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
} else { } else {
$profile_in_dir = Renderer::replaceMacros($opt_tpl, [ $profile_in_dir = Renderer::replaceMacros($opt_tpl, [
@ -1085,9 +1085,9 @@ function settings_content(App $a)
]); ]);
} }
if (strlen(Config::get('system', 'directory'))) { if (strlen(DI::config()->get('system', 'directory'))) {
$profile_in_net_dir = Renderer::replaceMacros($opt_tpl, [ $profile_in_net_dir = Renderer::replaceMacros($opt_tpl, [
'$field' => ['profile_in_netdirectory', DI::l10n()->t('Publish your default profile in the global social directory?'), $profile['net-publish'], DI::l10n()->t('Your profile will be published in the global friendica directories (e.g. <a href="%s">%s</a>). Your profile will be visible in public.', Config::get('system', 'directory'), Config::get('system', 'directory')) . " " . DI::l10n()->t("This setting also determines whether Friendica will inform search engines that your profile should be indexed or not. Third-party search engines may or may not respect this setting."), [DI::l10n()->t('No'), DI::l10n()->t('Yes')]] '$field' => ['profile_in_netdirectory', DI::l10n()->t('Publish your default profile in the global social directory?'), $profile['net-publish'], DI::l10n()->t('Your profile will be published in the global friendica directories (e.g. <a href="%s">%s</a>). Your profile will be visible in public.', DI::config()->get('system', 'directory'), DI::config()->get('system', 'directory')) . " " . DI::l10n()->t("This setting also determines whether Friendica will inform search engines that your profile should be indexed or not. Third-party search engines may or may not respect this setting."), [DI::l10n()->t('No'), DI::l10n()->t('Yes')]]
]); ]);
} else { } else {
$profile_in_net_dir = ''; $profile_in_net_dir = '';
@ -1181,7 +1181,7 @@ function settings_content(App $a)
'$password2'=> ['confirm', DI::l10n()->t('Confirm:'), '', DI::l10n()->t('Leave password fields blank unless changing')], '$password2'=> ['confirm', DI::l10n()->t('Confirm:'), '', DI::l10n()->t('Leave password fields blank unless changing')],
'$password3'=> ['opassword', DI::l10n()->t('Current Password:'), '', DI::l10n()->t('Your current password to confirm the changes')], '$password3'=> ['opassword', DI::l10n()->t('Current Password:'), '', DI::l10n()->t('Your current password to confirm the changes')],
'$password4'=> ['mpassword', DI::l10n()->t('Password:'), '', DI::l10n()->t('Your current password to confirm the changes')], '$password4'=> ['mpassword', DI::l10n()->t('Password:'), '', DI::l10n()->t('Your current password to confirm the changes')],
'$oid_enable' => (!Config::get('system', 'no_openid')), '$oid_enable' => (!DI::config()->get('system', 'no_openid')),
'$openid' => $openid_field, '$openid' => $openid_field,
'$delete_openid' => ['delete_openid', DI::l10n()->t('Delete OpenID URL'), false, ''], '$delete_openid' => ['delete_openid', DI::l10n()->t('Delete OpenID URL'), false, ''],
@ -1256,7 +1256,7 @@ function settings_content(App $a)
'$importcontact' => DI::l10n()->t('Import Contacts'), '$importcontact' => DI::l10n()->t('Import Contacts'),
'$importcontact_text' => DI::l10n()->t('Upload a CSV file that contains the handle of your followed accounts in the first column you exported from the old account.'), '$importcontact_text' => DI::l10n()->t('Upload a CSV file that contains the handle of your followed accounts in the first column you exported from the old account.'),
'$importcontact_button' => DI::l10n()->t('Upload File'), '$importcontact_button' => DI::l10n()->t('Upload File'),
'$importcontact_maxsize' => Config::get('system', 'max_csv_file_size', 30720), '$importcontact_maxsize' => DI::config()->get('system', 'max_csv_file_size', 30720),
'$relocate' => DI::l10n()->t('Relocate'), '$relocate' => DI::l10n()->t('Relocate'),
'$relocate_text' => DI::l10n()->t("If you have moved this profile from another server, and some of your contacts don't receive your updates, try pushing this button."), '$relocate_text' => DI::l10n()->t("If you have moved this profile from another server, and some of your contacts don't receive your updates, try pushing this button."),
'$relocate_button' => DI::l10n()->t("Resend relocate message to contacts"), '$relocate_button' => DI::l10n()->t("Resend relocate message to contacts"),

View file

@ -13,7 +13,7 @@ use Friendica\DI;
function uimport_post(App $a) function uimport_post(App $a)
{ {
if ((Config::get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) { if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) {
notice(DI::l10n()->t('Permission denied.') . EOL); notice(DI::l10n()->t('Permission denied.') . EOL);
return; return;
} }
@ -26,12 +26,12 @@ function uimport_post(App $a)
function uimport_content(App $a) function uimport_content(App $a)
{ {
if ((Config::get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) { if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) {
notice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.') . EOL); notice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.') . EOL);
return; return;
} }
$max_dailies = intval(Config::get('system', 'max_daily_registrations')); $max_dailies = intval(DI::config()->get('system', 'max_daily_registrations'));
if ($max_dailies) { if ($max_dailies) {
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day"); $r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
if ($r && $r[0]['total'] >= $max_dailies) { if ($r && $r[0]['total'] >= $max_dailies) {

View file

@ -20,7 +20,7 @@ use Friendica\Util\Security;
function videos_init(App $a) function videos_init(App $a)
{ {
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
return; return;
} }
@ -108,7 +108,7 @@ function videos_content(App $a)
// videos/name/video/xxxxx/edit // videos/name/video/xxxxx/edit
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
notice(DI::l10n()->t('Public access denied.') . EOL); notice(DI::l10n()->t('Public access denied.') . EOL);
return; return;
} }

View file

@ -78,7 +78,7 @@ function wall_attach_post(App $a) {
$filename = basename($_FILES['userfile']['name']); $filename = basename($_FILES['userfile']['name']);
$filesize = intval($_FILES['userfile']['size']); $filesize = intval($_FILES['userfile']['size']);
$maxfilesize = Config::get('system','maxfilesize'); $maxfilesize = DI::config()->get('system','maxfilesize');
/* Found html code written in text field of form, /* Found html code written in text field of form,
* when trying to upload a file with filesize * when trying to upload a file with filesize

View file

@ -179,7 +179,7 @@ function wall_upload_post(App $a, $desktopmode = true)
Logger::log("File upload src: " . $src . " - filename: " . $filename . Logger::log("File upload src: " . $src . " - filename: " . $filename .
" - size: " . $filesize . " - type: " . $filetype, Logger::DEBUG); " - size: " . $filesize . " - type: " . $filetype, Logger::DEBUG);
$maximagesize = Config::get('system', 'maximagesize'); $maximagesize = DI::config()->get('system', 'maximagesize');
if (($maximagesize) && ($filesize > $maximagesize)) { if (($maximagesize) && ($filesize > $maximagesize)) {
$msg = DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)); $msg = DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize));
@ -209,7 +209,7 @@ function wall_upload_post(App $a, $desktopmode = true)
$Image->orient($src); $Image->orient($src);
@unlink($src); @unlink($src);
$max_length = Config::get('system', 'max_image_length'); $max_length = DI::config()->get('system', 'max_image_length');
if (!$max_length) { if (!$max_length) {
$max_length = MAX_IMAGE_LENGTH; $max_length = MAX_IMAGE_LENGTH;
} }

View file

@ -13,7 +13,7 @@ use Friendica\Util\DateTimeFormat;
function worker_init() function worker_init()
{ {
if (!Config::get("system", "frontend_worker")) { if (!DI::config()->get("system", "frontend_worker")) {
return; return;
} }
@ -31,7 +31,7 @@ function worker_init()
$workers = q("SELECT COUNT(*) AS `processes` FROM `process` WHERE `command` = 'worker.php'"); $workers = q("SELECT COUNT(*) AS `processes` FROM `process` WHERE `command` = 'worker.php'");
if ($workers[0]["processes"] > Config::get("system", "worker_queues", 4)) { if ($workers[0]["processes"] > DI::config()->get("system", "worker_queues", 4)) {
return; return;
} }

View file

@ -52,27 +52,27 @@ class Instance extends BaseEntity
*/ */
public static function get() public static function get()
{ {
$register_policy = intval(Config::get('config', 'register_policy')); $register_policy = intval(DI::config()->get('config', 'register_policy'));
$baseUrl = DI::baseUrl(); $baseUrl = DI::baseUrl();
$instance = new Instance(); $instance = new Instance();
$instance->uri = $baseUrl->get(); $instance->uri = $baseUrl->get();
$instance->title = Config::get('config', 'sitename'); $instance->title = DI::config()->get('config', 'sitename');
$instance->description = Config::get('config', 'info'); $instance->description = DI::config()->get('config', 'info');
$instance->email = Config::get('config', 'admin_email'); $instance->email = DI::config()->get('config', 'admin_email');
$instance->version = FRIENDICA_VERSION; $instance->version = FRIENDICA_VERSION;
$instance->urls = []; // Not supported $instance->urls = []; // Not supported
$instance->stats = Stats::get(); $instance->stats = Stats::get();
$instance->thumbnail = $baseUrl->get() . (Config::get('system', 'shortcut_icon') ?? 'images/friendica-32.png'); $instance->thumbnail = $baseUrl->get() . (DI::config()->get('system', 'shortcut_icon') ?? 'images/friendica-32.png');
$instance->languages = [Config::get('system', 'language')]; $instance->languages = [DI::config()->get('system', 'language')];
$instance->max_toot_chars = (int)Config::get('config', 'api_import_size', Config::get('config', 'max_import_size')); $instance->max_toot_chars = (int)DI::config()->get('config', 'api_import_size', DI::config()->get('config', 'max_import_size'));
$instance->registrations = ($register_policy != Register::CLOSED); $instance->registrations = ($register_policy != Register::CLOSED);
$instance->approval_required = ($register_policy == Register::APPROVE); $instance->approval_required = ($register_policy == Register::APPROVE);
$instance->contact_account = []; $instance->contact_account = [];
if (!empty(Config::get('config', 'admin_email'))) { if (!empty(DI::config()->get('config', 'admin_email'))) {
$adminList = explode(',', str_replace(' ', '', Config::get('config', 'admin_email'))); $adminList = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email')));
$administrator = User::getByEmail($adminList[0], ['nickname']); $administrator = User::getByEmail($adminList[0], ['nickname']);
if (!empty($administrator)) { if (!empty($administrator)) {
$adminContact = DBA::selectFirst('contact', ['id'], ['nick' => $administrator['nickname'], 'self' => true]); $adminContact = DBA::selectFirst('contact', ['id'], ['nick' => $administrator['nickname'], 'self' => true]);

View file

@ -29,9 +29,9 @@ class Stats extends BaseEntity
*/ */
public static function get() { public static function get() {
$stats = new Stats(); $stats = new Stats();
if (!empty(Config::get('system', 'nodeinfo'))) { if (!empty(DI::config()->get('system', 'nodeinfo'))) {
$stats->user_count = intval(Config::get('nodeinfo', 'total_users')); $stats->user_count = intval(DI::config()->get('nodeinfo', 'total_users'));
$stats->status_count = Config::get('nodeinfo', 'local_posts') + Config::get('nodeinfo', 'local_comments'); $stats->status_count = DI::config()->get('nodeinfo', 'local_posts') + DI::config()->get('nodeinfo', 'local_comments');
$stats->domain_count = DBA::count('gserver', ["`network` in (?, ?) AND `last_contact` >= `last_failure`", Protocol::DFRN, Protocol::ACTIVITYPUB]); $stats->domain_count = DBA::count('gserver', ["`network` in (?, ?) AND `last_contact` >= `last_failure`", Protocol::DFRN, Protocol::ACTIVITYPUB]);
} }
return $stats; return $stats;

View file

@ -21,14 +21,14 @@ class Feature
*/ */
public static function isEnabled(int $uid, $feature) public static function isEnabled(int $uid, $feature)
{ {
$x = Config::get('feature_lock', $feature, false); $x = DI::config()->get('feature_lock', $feature, false);
if ($x === false) { if ($x === false) {
$x = DI::pConfig()->get($uid, 'feature', $feature, false); $x = DI::pConfig()->get($uid, 'feature', $feature, false);
} }
if ($x === false) { if ($x === false) {
$x = Config::get('feature', $feature, false); $x = DI::config()->get('feature', $feature, false);
} }
if ($x === false) { if ($x === false) {
@ -80,45 +80,45 @@ class Feature
'general' => [ 'general' => [
DI::l10n()->t('General Features'), DI::l10n()->t('General Features'),
//array('expire', DI::l10n()->t('Content Expiration'), DI::l10n()->t('Remove old posts/comments after a period of time')), //array('expire', DI::l10n()->t('Content Expiration'), DI::l10n()->t('Remove old posts/comments after a period of time')),
['multi_profiles', DI::l10n()->t('Multiple Profiles'), DI::l10n()->t('Ability to create multiple profiles'), false, Config::get('feature_lock', 'multi_profiles', false)], ['multi_profiles', DI::l10n()->t('Multiple Profiles'), DI::l10n()->t('Ability to create multiple profiles'), false, DI::config()->get('feature_lock', 'multi_profiles', false)],
['photo_location', DI::l10n()->t('Photo Location'), DI::l10n()->t("Photo metadata is normally stripped. This extracts the location \x28if present\x29 prior to stripping metadata and links it to a map."), false, Config::get('feature_lock', 'photo_location', false)], ['photo_location', DI::l10n()->t('Photo Location'), DI::l10n()->t("Photo metadata is normally stripped. This extracts the location \x28if present\x29 prior to stripping metadata and links it to a map."), false, DI::config()->get('feature_lock', 'photo_location', false)],
['export_calendar', DI::l10n()->t('Export Public Calendar'), DI::l10n()->t('Ability for visitors to download the public calendar'), false, Config::get('feature_lock', 'export_calendar', false)], ['export_calendar', DI::l10n()->t('Export Public Calendar'), DI::l10n()->t('Ability for visitors to download the public calendar'), false, DI::config()->get('feature_lock', 'export_calendar', false)],
['trending_tags', DI::l10n()->t('Trending Tags'), DI::l10n()->t('Show a community page widget with a list of the most popular tags in recent public posts.'), false, Config::get('feature_lock', 'trending_tags', false)], ['trending_tags', DI::l10n()->t('Trending Tags'), DI::l10n()->t('Show a community page widget with a list of the most popular tags in recent public posts.'), false, DI::config()->get('feature_lock', 'trending_tags', false)],
], ],
// Post composition // Post composition
'composition' => [ 'composition' => [
DI::l10n()->t('Post Composition Features'), DI::l10n()->t('Post Composition Features'),
['aclautomention', DI::l10n()->t('Auto-mention Forums'), DI::l10n()->t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock', 'aclautomention', false)], ['aclautomention', DI::l10n()->t('Auto-mention Forums'), DI::l10n()->t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, DI::config()->get('feature_lock', 'aclautomention', false)],
['explicit_mentions', DI::l10n()->t('Explicit Mentions'), DI::l10n()->t('Add explicit mentions to comment box for manual control over who gets mentioned in replies.'), false, Config::get('feature_lock', 'explicit_mentions', false)], ['explicit_mentions', DI::l10n()->t('Explicit Mentions'), DI::l10n()->t('Add explicit mentions to comment box for manual control over who gets mentioned in replies.'), false, DI::config()->get('feature_lock', 'explicit_mentions', false)],
], ],
// Network sidebar widgets // Network sidebar widgets
'widgets' => [ 'widgets' => [
DI::l10n()->t('Network Sidebar'), DI::l10n()->t('Network Sidebar'),
['archives', DI::l10n()->t('Archives'), DI::l10n()->t('Ability to select posts by date ranges'), false, Config::get('feature_lock', 'archives', false)], ['archives', DI::l10n()->t('Archives'), DI::l10n()->t('Ability to select posts by date ranges'), false, DI::config()->get('feature_lock', 'archives', false)],
['networks', DI::l10n()->t('Protocol Filter'), DI::l10n()->t('Enable widget to display Network posts only from selected protocols'), false, Config::get('feature_lock', 'networks', false)], ['networks', DI::l10n()->t('Protocol Filter'), DI::l10n()->t('Enable widget to display Network posts only from selected protocols'), false, DI::config()->get('feature_lock', 'networks', false)],
], ],
// Network tabs // Network tabs
'net_tabs' => [ 'net_tabs' => [
DI::l10n()->t('Network Tabs'), DI::l10n()->t('Network Tabs'),
['new_tab', DI::l10n()->t('Network New Tab'), DI::l10n()->t("Enable tab to display only new Network posts \x28from the last 12 hours\x29"), false, Config::get('feature_lock', 'new_tab', false)], ['new_tab', DI::l10n()->t('Network New Tab'), DI::l10n()->t("Enable tab to display only new Network posts \x28from the last 12 hours\x29"), false, DI::config()->get('feature_lock', 'new_tab', false)],
['link_tab', DI::l10n()->t('Network Shared Links Tab'), DI::l10n()->t('Enable tab to display only Network posts with links in them'), false, Config::get('feature_lock', 'link_tab', false)], ['link_tab', DI::l10n()->t('Network Shared Links Tab'), DI::l10n()->t('Enable tab to display only Network posts with links in them'), false, DI::config()->get('feature_lock', 'link_tab', false)],
], ],
// Item tools // Item tools
'tools' => [ 'tools' => [
DI::l10n()->t('Post/Comment Tools'), DI::l10n()->t('Post/Comment Tools'),
['categories', DI::l10n()->t('Post Categories'), DI::l10n()->t('Add categories to your posts'), false, Config::get('feature_lock', 'categories', false)], ['categories', DI::l10n()->t('Post Categories'), DI::l10n()->t('Add categories to your posts'), false, DI::config()->get('feature_lock', 'categories', false)],
], ],
// Advanced Profile Settings // Advanced Profile Settings
'advanced_profile' => [ 'advanced_profile' => [
DI::l10n()->t('Advanced Profile Settings'), DI::l10n()->t('Advanced Profile Settings'),
['forumlist_profile', DI::l10n()->t('List Forums'), DI::l10n()->t('Show visitors public community forums at the Advanced Profile Page'), false, Config::get('feature_lock', 'forumlist_profile', false)], ['forumlist_profile', DI::l10n()->t('List Forums'), DI::l10n()->t('Show visitors public community forums at the Advanced Profile Page'), false, DI::config()->get('feature_lock', 'forumlist_profile', false)],
['tagadelic', DI::l10n()->t('Tag Cloud'), DI::l10n()->t('Provide a personal tag cloud on your profile page'), false, Config::get('feature_lock', 'tagadelic', false)], ['tagadelic', DI::l10n()->t('Tag Cloud'), DI::l10n()->t('Provide a personal tag cloud on your profile page'), false, DI::config()->get('feature_lock', 'tagadelic', false)],
['profile_membersince', DI::l10n()->t('Display Membership Date'), DI::l10n()->t('Display membership date in profile'), false, Config::get('feature_lock', 'profile_membersince', false)], ['profile_membersince', DI::l10n()->t('Display Membership Date'), DI::l10n()->t('Display membership date in profile'), false, DI::config()->get('feature_lock', 'profile_membersince', false)],
], ],
]; ];

View file

@ -105,7 +105,7 @@ class Nav
self::$app_menu = []; self::$app_menu = [];
//Don't populate apps_menu if apps are private //Don't populate apps_menu if apps are private
$privateapps = Config::get('config', 'private_addons', false); $privateapps = DI::config()->get('config', 'private_addons', false);
if (local_user() || !$privateapps) { if (local_user() || !$privateapps) {
$arr = ['app_menu' => self::$app_menu]; $arr = ['app_menu' => self::$app_menu];
@ -180,13 +180,13 @@ class Nav
$nav['home'] = [$homelink, DI::l10n()->t('Home'), '', DI::l10n()->t('Home Page')]; $nav['home'] = [$homelink, DI::l10n()->t('Home'), '', DI::l10n()->t('Home Page')];
} }
if (intval(Config::get('config', 'register_policy')) === \Friendica\Module\Register::OPEN && !Session::isAuthenticated()) { if (intval(DI::config()->get('config', 'register_policy')) === \Friendica\Module\Register::OPEN && !Session::isAuthenticated()) {
$nav['register'] = ['register', DI::l10n()->t('Register'), '', DI::l10n()->t('Create an account')]; $nav['register'] = ['register', DI::l10n()->t('Register'), '', DI::l10n()->t('Create an account')];
} }
$help_url = 'help'; $help_url = 'help';
if (!Config::get('system', 'hide_help')) { if (!DI::config()->get('system', 'hide_help')) {
$nav['help'] = [$help_url, DI::l10n()->t('Help'), '', DI::l10n()->t('Help and documentation')]; $nav['help'] = [$help_url, DI::l10n()->t('Help'), '', DI::l10n()->t('Help and documentation')];
} }
@ -194,7 +194,7 @@ class Nav
$nav['apps'] = ['apps', DI::l10n()->t('Apps'), '', DI::l10n()->t('Addon applications, utilities, games')]; $nav['apps'] = ['apps', DI::l10n()->t('Apps'), '', DI::l10n()->t('Addon applications, utilities, games')];
} }
if (local_user() || !Config::get('system', 'local_search')) { if (local_user() || !DI::config()->get('system', 'local_search')) {
$nav['search'] = ['search', DI::l10n()->t('Search'), '', DI::l10n()->t('Search site content')]; $nav['search'] = ['search', DI::l10n()->t('Search'), '', DI::l10n()->t('Search site content')];
$nav['searchoption'] = [ $nav['searchoption'] = [
@ -203,22 +203,22 @@ class Nav
DI::l10n()->t('Contacts') DI::l10n()->t('Contacts')
]; ];
if (Config::get('system', 'poco_local_search')) { if (DI::config()->get('system', 'poco_local_search')) {
$nav['searchoption'][] = DI::l10n()->t('Forums'); $nav['searchoption'][] = DI::l10n()->t('Forums');
} }
} }
$gdirpath = 'directory'; $gdirpath = 'directory';
if (strlen(Config::get('system', 'singleuser'))) { if (strlen(DI::config()->get('system', 'singleuser'))) {
$gdir = Config::get('system', 'directory'); $gdir = DI::config()->get('system', 'directory');
if (strlen($gdir)) { if (strlen($gdir)) {
$gdirpath = Profile::zrl($gdir, true); $gdirpath = Profile::zrl($gdir, true);
} }
} }
if ((local_user() || Config::get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) && if ((local_user() || DI::config()->get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) &&
!(Config::get('system', 'community_page_style') == CP_NO_INTERNAL_COMMUNITY)) { !(DI::config()->get('system', 'community_page_style') == CP_NO_INTERNAL_COMMUNITY)) {
$nav['community'] = ['community', DI::l10n()->t('Community'), '', DI::l10n()->t('Conversations on this and other servers')]; $nav['community'] = ['community', DI::l10n()->t('Community'), '', DI::l10n()->t('Conversations on this and other servers')];
} }
@ -230,7 +230,7 @@ class Nav
$nav['about'] = ['friendica', DI::l10n()->t('Information'), '', DI::l10n()->t('Information about this friendica instance')]; $nav['about'] = ['friendica', DI::l10n()->t('Information'), '', DI::l10n()->t('Information about this friendica instance')];
if (Config::get('system', 'tosdisplay')) { if (DI::config()->get('system', 'tosdisplay')) {
$nav['tos'] = ['tos', DI::l10n()->t('Terms of Service'), '', DI::l10n()->t('Terms of Service of this Friendica instance')]; $nav['tos'] = ['tos', DI::l10n()->t('Terms of Service'), '', DI::l10n()->t('Terms of Service of this Friendica instance')];
} }
@ -274,7 +274,7 @@ class Nav
$nav['navigation'] = ['navigation/', DI::l10n()->t('Navigation'), '', DI::l10n()->t('Site map')]; $nav['navigation'] = ['navigation/', DI::l10n()->t('Navigation'), '', DI::l10n()->t('Site map')];
// Provide a banner/logo/whatever // Provide a banner/logo/whatever
$banner = Config::get('system', 'banner'); $banner = DI::config()->get('system', 'banner');
if (is_null($banner)) { if (is_null($banner)) {
$banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>'; $banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
} }

View file

@ -248,7 +248,7 @@ class OEmbed
public static function BBCode2HTML($text) public static function BBCode2HTML($text)
{ {
$stopoembed = Config::get("system", "no_oembed"); $stopoembed = DI::config()->get("system", "no_oembed");
if ($stopoembed == true) { if ($stopoembed == true) {
return preg_replace("/\[embed\](.+?)\[\/embed\]/is", "<!-- oembed $1 --><i>" . DI::l10n()->t('Embedding disabled') . " : $1</i><!-- /oembed $1 -->", $text); return preg_replace("/\[embed\](.+?)\[\/embed\]/is", "<!-- oembed $1 --><i>" . DI::l10n()->t('Embedding disabled') . " : $1</i><!-- /oembed $1 -->", $text);
} }
@ -302,7 +302,7 @@ class OEmbed
*/ */
public static function isAllowedURL($url) public static function isAllowedURL($url)
{ {
if (!Config::get('system', 'no_oembed_rich_content')) { if (!DI::config()->get('system', 'no_oembed_rich_content')) {
return true; return true;
} }
@ -311,7 +311,7 @@ class OEmbed
return false; return false;
} }
$str_allowed = Config::get('system', 'allowed_oembed', ''); $str_allowed = DI::config()->get('system', 'allowed_oembed', '');
if (empty($str_allowed)) { if (empty($str_allowed)) {
return false; return false;
} }

View file

@ -207,7 +207,7 @@ class Smilies
*/ */
public static function replaceFromArray($text, array $smilies, $no_images = false) public static function replaceFromArray($text, array $smilies, $no_images = false)
{ {
if (intval(Config::get('system', 'no_smilies')) if (intval(DI::config()->get('system', 'no_smilies'))
|| (local_user() && intval(DI::pConfig()->get(local_user(), 'system', 'no_smilies'))) || (local_user() && intval(DI::pConfig()->get(local_user(), 'system', 'no_smilies')))
) { ) {
return $text; return $text;

View file

@ -496,7 +496,7 @@ class BBCode
*/ */
public static function limitBodySize($body) public static function limitBodySize($body)
{ {
$maxlen = Config::get('config', 'max_import_size', 0); $maxlen = DI::config()->get('config', 'max_import_size', 0);
// If the length of the body, including the embedded images, is smaller // If the length of the body, including the embedded images, is smaller
// than the maximum, then don't waste time looking for the images // than the maximum, then don't waste time looking for the images
@ -598,7 +598,7 @@ class BBCode
$data['title'] = null; $data['title'] = null;
} }
if (((strpos($data['text'], "[img=") !== false) || (strpos($data['text'], "[img]") !== false) || Config::get('system', 'always_show_preview')) && !empty($data['image'])) { if (((strpos($data['text'], "[img=") !== false) || (strpos($data['text'], "[img]") !== false) || DI::config()->get('system', 'always_show_preview')) && !empty($data['image'])) {
$data['preview'] = $data['image']; $data['preview'] = $data['image'];
$data['image'] = ''; $data['image'] = '';
} }
@ -1345,7 +1345,7 @@ class BBCode
$text = str_replace($search, $replace, $text); $text = str_replace($search, $replace, $text);
// removing multiplicated newlines // removing multiplicated newlines
if (Config::get('system', 'remove_multiplicated_lines')) { if (DI::config()->get('system', 'remove_multiplicated_lines')) {
$search = ["\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share ", "[/attachment]\n", $search = ["\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share ", "[/attachment]\n",
"\n[h1]", "[/h1]\n", "\n[h2]", "[/h2]\n", "\n[h3]", "[/h3]\n", "\n[h4]", "[/h4]\n", "\n[h5]", "[/h5]\n", "\n[h6]", "[/h6]\n"]; "\n[h1]", "[/h1]\n", "\n[h2]", "[/h2]\n", "\n[h3]", "[/h3]\n", "\n[h4]", "[/h4]\n", "\n[h5]", "[/h5]\n", "\n[h6]", "[/h6]\n"];
$replace = ["\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share ", "[/attachment]", $replace = ["\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share ", "[/attachment]",
@ -1835,7 +1835,7 @@ class BBCode
// sanitize href attributes (only whitelisted protocols URLs) // sanitize href attributes (only whitelisted protocols URLs)
// default value for backward compatibility // default value for backward compatibility
$allowed_link_protocols = Config::get('system', 'allowed_link_protocols', []); $allowed_link_protocols = DI::config()->get('system', 'allowed_link_protocols', []);
// Always allowed protocol even if config isn't set or not including it // Always allowed protocol even if config isn't set or not including it
$allowed_link_protocols[] = '//'; $allowed_link_protocols[] = '//';

View file

@ -912,7 +912,7 @@ class HTML
'contacts' => DI::l10n()->t('Contacts') 'contacts' => DI::l10n()->t('Contacts')
]; ];
if (Config::get('system', 'poco_local_search')) { if (DI::config()->get('system', 'poco_local_search')) {
$values['$searchoption']['forums'] = DI::l10n()->t('Forums'); $values['$searchoption']['forums'] = DI::l10n()->t('Forums');
} }
} }

View file

@ -46,9 +46,9 @@ class Widget
*/ */
public static function findPeople() public static function findPeople()
{ {
$global_dir = Config::get('system', 'directory'); $global_dir = DI::config()->get('system', 'directory');
if (Config::get('system', 'invitation_only')) { if (DI::config()->get('system', 'invitation_only')) {
$x = intval(DI::pConfig()->get(local_user(), 'system', 'invites_remaining')); $x = intval(DI::pConfig()->get(local_user(), 'system', 'invites_remaining'));
if ($x || is_site_admin()) { if ($x || is_site_admin()) {
DI::page()['aside'] .= '<div class="side-link widget" id="side-invite-remain">' DI::page()['aside'] .= '<div class="side-link widget" id="side-invite-remain">'
@ -101,11 +101,11 @@ class Widget
$networks[] = Protocol::TWITTER; $networks[] = Protocol::TWITTER;
} }
if (Config::get("system", "ostatus_disabled")) { if (DI::config()->get("system", "ostatus_disabled")) {
$networks[] = Protocol::OSTATUS; $networks[] = Protocol::OSTATUS;
} }
if (!Config::get("system", "diaspora_enabled")) { if (!DI::config()->get("system", "diaspora_enabled")) {
$networks[] = Protocol::DIASPORA; $networks[] = Protocol::DIASPORA;
} }

View file

@ -349,7 +349,7 @@ class ACL
$mail_enabled = false; $mail_enabled = false;
$pubmail_enabled = false; $pubmail_enabled = false;
if (function_exists('imap_open') && !Config::get('system', 'imap_disabled')) { if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) {
$mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', $user['uid']]); $mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', $user['uid']]);
if (DBA::isResult($mailacct)) { if (DBA::isResult($mailacct)) {
$mail_enabled = true; $mail_enabled = true;

View file

@ -45,7 +45,7 @@ class Addon
list($tmp, $addon) = array_map('trim', explode('/', $file)); list($tmp, $addon) = array_map('trim', explode('/', $file));
$info = self::getInfo($addon); $info = self::getInfo($addon);
if (Config::get('system', 'show_unsupported_addons') if (DI::config()->get('system', 'show_unsupported_addons')
|| strtolower($info['status']) != 'unsupported' || strtolower($info['status']) != 'unsupported'
|| self::isEnabled($addon) || self::isEnabled($addon)
) { ) {
@ -103,7 +103,7 @@ class Addon
$installed_addons = DBA::toArray($r); $installed_addons = DBA::toArray($r);
} }
$addons = Config::get('system', 'addon'); $addons = DI::config()->get('system', 'addon');
$addons_arr = []; $addons_arr = [];
if ($addons) { if ($addons) {
@ -210,7 +210,7 @@ class Addon
*/ */
public static function reload() public static function reload()
{ {
$addons = Config::get('system', 'addon'); $addons = DI::config()->get('system', 'addon');
if (strlen($addons)) { if (strlen($addons)) {
$r = DBA::select('addon', [], ['installed' => 1]); $r = DBA::select('addon', [], ['installed' => 1]);
if (DBA::isResult($r)) { if (DBA::isResult($r)) {

View file

@ -19,21 +19,6 @@ use Friendica\DI;
*/ */
class Config class Config
{ {
/**
* Get a particular user's config variable given the category name ($family) and a key.
*
* @param string $cat The category of the configuration value
* @param string $key The configuration key to query
* @param mixed $default_value optional, The value to return if key is not set (default: null)
* @param boolean $refresh optional, If true the config is loaded from the db and not from the cache (default: false)
*
* @return mixed Stored value or null if it does not exist
*/
public static function get($cat, $key, $default_value = null, $refresh = false)
{
return DI::config()->get($cat, $key, $default_value, $refresh);
}
/** /**
* Stores a config value ($value) in the category ($cat) under the key ($key) * Stores a config value ($value) in the category ($cat) under the key ($key)
* *

View file

@ -253,7 +253,7 @@ class Search
*/ */
public static function searchGlobalContact($search, $mode, int $page = 1) public static function searchGlobalContact($search, $mode, int $page = 1)
{ {
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
return []; return [];
} }
@ -267,7 +267,7 @@ class Search
} }
// check if searching in the local global contact table is enabled // check if searching in the local global contact table is enabled
if (Config::get('system', 'poco_local_search')) { if (DI::config()->get('system', 'poco_local_search')) {
$return = GContact::searchByName($search, $mode); $return = GContact::searchByName($search, $mode);
} else { } else {
$p = $page > 1 ? 'p=' . $page : ''; $p = $page > 1 ? 'p=' . $page : '';
@ -290,6 +290,6 @@ class Search
*/ */
public static function getGlobalDirectory() public static function getGlobalDirectory()
{ {
return Config::get('system', 'directory', self::DEFAULT_DIRECTORY); return DI::config()->get('system', 'directory', self::DEFAULT_DIRECTORY);
} }
} }

View file

@ -19,7 +19,7 @@ class Theme
{ {
public static function getAllowedList() public static function getAllowedList()
{ {
$allowed_themes_str = Config::get('system', 'allowed_themes'); $allowed_themes_str = DI::config()->get('system', 'allowed_themes');
$allowed_themes_raw = explode(',', str_replace(' ', '', $allowed_themes_str)); $allowed_themes_raw = explode(',', str_replace(' ', '', $allowed_themes_str));
$allowed_themes = []; $allowed_themes = [];
if (count($allowed_themes_raw)) { if (count($allowed_themes_raw)) {

View file

@ -29,11 +29,11 @@ class Update
} }
// Don't check the status if the last update was failed // Don't check the status if the last update was failed
if (Config::get('system', 'update', Update::SUCCESS, true) == Update::FAILED) { if (DI::config()->get('system', 'update', Update::SUCCESS, true) == Update::FAILED) {
return; return;
} }
$build = Config::get('system', 'build'); $build = DI::config()->get('system', 'build');
if (empty($build)) { if (empty($build)) {
Config::set('system', 'build', DB_UPDATE_VERSION - 1); Config::set('system', 'build', DB_UPDATE_VERSION - 1);
@ -77,7 +77,7 @@ class Update
DI::lock()->release('dbupdate', true); DI::lock()->release('dbupdate', true);
} }
$build = Config::get('system', 'build', null, true); $build = DI::config()->get('system', 'build', null, true);
if (empty($build) || ($build > DB_UPDATE_VERSION)) { if (empty($build) || ($build > DB_UPDATE_VERSION)) {
$build = DB_UPDATE_VERSION - 1; $build = DB_UPDATE_VERSION - 1;
@ -99,7 +99,7 @@ class Update
if (DI::lock()->acquire('dbupdate', 120, Cache\Duration::INFINITE)) { if (DI::lock()->acquire('dbupdate', 120, Cache\Duration::INFINITE)) {
// Checks if the build changed during Lock acquiring (so no double update occurs) // Checks if the build changed during Lock acquiring (so no double update occurs)
$retryBuild = Config::get('system', 'build', null, true); $retryBuild = DI::config()->get('system', 'build', null, true);
if ($retryBuild !== $build) { if ($retryBuild !== $build) {
Logger::info('Update already done.', ['from' => $stored, 'to' => $current]); Logger::info('Update already done.', ['from' => $stored, 'to' => $current]);
DI::lock()->release('dbupdate'); DI::lock()->release('dbupdate');
@ -232,7 +232,7 @@ class Update
*/ */
private static function updateFailed($update_id, $error_message) { private static function updateFailed($update_id, $error_message) {
//send the administrators an e-mail //send the administrators an e-mail
$condition = ['email' => explode(",", str_replace(" ", "", Config::get('config', 'admin_email'))), 'parent-uid' => 0]; $condition = ['email' => explode(",", str_replace(" ", "", DI::config()->get('config', 'admin_email'))), 'parent-uid' => 0];
$adminlist = DBA::select('user', ['uid', 'language', 'email'], $condition, ['order' => ['uid']]); $adminlist = DBA::select('user', ['uid', 'language', 'email'], $condition, ['order' => ['uid']]);
// No valid result? // No valid result?
@ -281,7 +281,7 @@ class Update
private static function updateSuccessfull($from_build, $to_build) private static function updateSuccessfull($from_build, $to_build)
{ {
//send the administrators an e-mail //send the administrators an e-mail
$condition = ['email' => explode(",", str_replace(" ", "", Config::get('config', 'admin_email'))), 'parent-uid' => 0]; $condition = ['email' => explode(",", str_replace(" ", "", DI::config()->get('config', 'admin_email'))), 'parent-uid' => 0];
$adminlist = DBA::select('user', ['uid', 'language', 'email'], $condition, ['order' => ['uid']]); $adminlist = DBA::select('user', ['uid', 'language', 'email'], $condition, ['order' => ['uid']]);
if (DBA::isResult($adminlist)) { if (DBA::isResult($adminlist)) {

View file

@ -63,7 +63,7 @@ class Worker
self::startProcess(); self::startProcess();
// Kill stale processes every 5 minutes // Kill stale processes every 5 minutes
$last_cleanup = Config::get('system', 'worker_last_cleaned', 0); $last_cleanup = DI::config()->get('system', 'worker_last_cleaned', 0);
if (time() > ($last_cleanup + 300)) { if (time() > ($last_cleanup + 300)) {
Config::set('system', 'worker_last_cleaned', time()); Config::set('system', 'worker_last_cleaned', time());
self::killStaleWorkers(); self::killStaleWorkers();
@ -148,7 +148,7 @@ class Worker
} }
// Quit the worker once every cron interval // Quit the worker once every cron interval
if (time() > ($starttime + (Config::get('system', 'cron_interval') * 60))) { if (time() > ($starttime + (DI::config()->get('system', 'cron_interval') * 60))) {
Logger::info('Process lifetime reached, respawning.'); Logger::info('Process lifetime reached, respawning.');
self::spawnWorker(); self::spawnWorker();
return; return;
@ -156,7 +156,7 @@ class Worker
} }
// Cleaning up. Possibly not needed, but it doesn't harm anything. // Cleaning up. Possibly not needed, but it doesn't harm anything.
if (Config::get('system', 'worker_daemon_mode', false)) { if (DI::config()->get('system', 'worker_daemon_mode', false)) {
self::IPCSetJobState(false); self::IPCSetJobState(false);
} }
Logger::log("Couldn't select a workerqueue entry, quitting process " . getmypid() . ".", Logger::DEBUG); Logger::log("Couldn't select a workerqueue entry, quitting process " . getmypid() . ".", Logger::DEBUG);
@ -252,7 +252,7 @@ class Worker
$mypid = getmypid(); $mypid = getmypid();
// Quit when in maintenance // Quit when in maintenance
if (Config::get('system', 'maintenance', false, true)) { if (DI::config()->get('system', 'maintenance', false, true)) {
Logger::log("Maintenance mode - quit process ".$mypid, Logger::DEBUG); Logger::log("Maintenance mode - quit process ".$mypid, Logger::DEBUG);
return false; return false;
} }
@ -441,7 +441,7 @@ class Worker
DI::profiler()->saveLog(DI::logger(), "ID " . $queue["id"] . ": " . $funcname); DI::profiler()->saveLog(DI::logger(), "ID " . $queue["id"] . ": " . $funcname);
$cooldown = Config::get("system", "worker_cooldown", 0); $cooldown = DI::config()->get("system", "worker_cooldown", 0);
if ($cooldown > 0) { if ($cooldown > 0) {
Logger::info('Cooldown.', ['priority' => $queue["priority"], 'id' => $queue["id"], 'cooldown' => $cooldown]); Logger::info('Cooldown.', ['priority' => $queue["priority"], 'id' => $queue["id"], 'cooldown' => $cooldown]);
@ -458,10 +458,10 @@ class Worker
private static function maxConnectionsReached() private static function maxConnectionsReached()
{ {
// Fetch the max value from the config. This is needed when the system cannot detect the correct value by itself. // Fetch the max value from the config. This is needed when the system cannot detect the correct value by itself.
$max = Config::get("system", "max_connections"); $max = DI::config()->get("system", "max_connections");
// Fetch the percentage level where the worker will get active // Fetch the percentage level where the worker will get active
$maxlevel = Config::get("system", "max_connections_level", 75); $maxlevel = DI::config()->get("system", "max_connections_level", 75);
if ($max == 0) { if ($max == 0) {
// the maximum number of possible user connections can be a system variable // the maximum number of possible user connections can be a system variable
@ -613,7 +613,7 @@ class Worker
*/ */
private static function tooMuchWorkers() private static function tooMuchWorkers()
{ {
$queues = Config::get("system", "worker_queues", 10); $queues = DI::config()->get("system", "worker_queues", 10);
$maxqueues = $queues; $maxqueues = $queues;
@ -622,21 +622,21 @@ class Worker
// Decrease the number of workers at higher load // Decrease the number of workers at higher load
$load = System::currentLoad(); $load = System::currentLoad();
if ($load) { if ($load) {
$maxsysload = intval(Config::get("system", "maxloadavg", 20)); $maxsysload = intval(DI::config()->get("system", "maxloadavg", 20));
/* Default exponent 3 causes queues to rapidly decrease as load increases. /* Default exponent 3 causes queues to rapidly decrease as load increases.
* If you have 20 max queues at idle, then you get only 5 queues at 37.1% of $maxsysload. * If you have 20 max queues at idle, then you get only 5 queues at 37.1% of $maxsysload.
* For some environments, this rapid decrease is not needed. * For some environments, this rapid decrease is not needed.
* With exponent 1, you could have 20 max queues at idle and 13 at 37% of $maxsysload. * With exponent 1, you could have 20 max queues at idle and 13 at 37% of $maxsysload.
*/ */
$exponent = intval(Config::get('system', 'worker_load_exponent', 3)); $exponent = intval(DI::config()->get('system', 'worker_load_exponent', 3));
$slope = pow(max(0, $maxsysload - $load) / $maxsysload, $exponent); $slope = pow(max(0, $maxsysload - $load) / $maxsysload, $exponent);
$queues = intval(ceil($slope * $maxqueues)); $queues = intval(ceil($slope * $maxqueues));
$processlist = ''; $processlist = '';
if (Config::get('system', 'worker_jpm')) { if (DI::config()->get('system', 'worker_jpm')) {
$intervals = explode(',', Config::get('system', 'worker_jpm_range')); $intervals = explode(',', DI::config()->get('system', 'worker_jpm_range'));
$jobs_per_minute = []; $jobs_per_minute = [];
foreach ($intervals as $interval) { foreach ($intervals as $interval) {
if ($interval == 0) { if ($interval == 0) {
@ -664,7 +664,7 @@ class Worker
$deferred = self::deferredEntries(); $deferred = self::deferredEntries();
if (Config::get('system', 'worker_debug')) { if (DI::config()->get('system', 'worker_debug')) {
$waiting_processes = 0; $waiting_processes = 0;
// Now adding all processes with workerqueue entries // Now adding all processes with workerqueue entries
$stamp = (float)microtime(true); $stamp = (float)microtime(true);
@ -704,7 +704,7 @@ class Worker
$processlist .= ' ('.implode(', ', $listitem).')'; $processlist .= ' ('.implode(', ', $listitem).')';
if (Config::get("system", "worker_fastlane", false) && ($queues > 0) && ($active >= $queues) && self::entriesExists()) { if (DI::config()->get("system", "worker_fastlane", false) && ($queues > 0) && ($active >= $queues) && self::entriesExists()) {
$top_priority = self::highestPriority(); $top_priority = self::highestPriority();
$high_running = self::processWithPriorityActive($top_priority); $high_running = self::processWithPriorityActive($top_priority);
@ -717,9 +717,9 @@ class Worker
Logger::log("Load: " . $load ."/" . $maxsysload . " - processes: " . $deferred . "/" . $active . "/" . $waiting_processes . $processlist . " - maximum: " . $queues . "/" . $maxqueues, Logger::DEBUG); Logger::log("Load: " . $load ."/" . $maxsysload . " - processes: " . $deferred . "/" . $active . "/" . $waiting_processes . $processlist . " - maximum: " . $queues . "/" . $maxqueues, Logger::DEBUG);
// Are there fewer workers running as possible? Then fork a new one. // Are there fewer workers running as possible? Then fork a new one.
if (!Config::get("system", "worker_dont_fork", false) && ($queues > ($active + 1)) && self::entriesExists()) { if (!DI::config()->get("system", "worker_dont_fork", false) && ($queues > ($active + 1)) && self::entriesExists()) {
Logger::log("Active workers: ".$active."/".$queues." Fork a new worker.", Logger::DEBUG); Logger::log("Active workers: ".$active."/".$queues." Fork a new worker.", Logger::DEBUG);
if (Config::get('system', 'worker_daemon_mode', false)) { if (DI::config()->get('system', 'worker_daemon_mode', false)) {
self::IPCSetJobState(true); self::IPCSetJobState(true);
} else { } else {
self::spawnWorker(); self::spawnWorker();
@ -728,7 +728,7 @@ class Worker
} }
// if there are too much worker, we don't spawn a new one. // if there are too much worker, we don't spawn a new one.
if (Config::get('system', 'worker_daemon_mode', false) && ($active > $queues)) { if (DI::config()->get('system', 'worker_daemon_mode', false) && ($active > $queues)) {
self::IPCSetJobState(false); self::IPCSetJobState(false);
} }
@ -782,7 +782,7 @@ class Worker
return []; return [];
} }
$limit = Config::get('system', 'worker_fetch_limit', 1); $limit = DI::config()->get('system', 'worker_fetch_limit', 1);
$ids = []; $ids = [];
$stamp = (float)microtime(true); $stamp = (float)microtime(true);
@ -890,7 +890,7 @@ class Worker
// If there is no result we check without priority limit // If there is no result we check without priority limit
if (empty($ids)) { if (empty($ids)) {
$limit = Config::get('system', 'worker_fetch_limit', 1); $limit = DI::config()->get('system', 'worker_fetch_limit', 1);
$stamp = (float)microtime(true); $stamp = (float)microtime(true);
$condition = ["`pid` = 0 AND NOT `done` AND `next_try` < ?", DateTimeFormat::utcNow()]; $condition = ["`pid` = 0 AND NOT `done` AND `next_try` < ?", DateTimeFormat::utcNow()];
@ -976,7 +976,7 @@ class Worker
*/ */
public static function callWorker() public static function callWorker()
{ {
if (!Config::get("system", "frontend_worker")) { if (!DI::config()->get("system", "frontend_worker")) {
return; return;
} }
@ -992,7 +992,7 @@ class Worker
*/ */
public static function executeIfIdle() public static function executeIfIdle()
{ {
if (!Config::get("system", "frontend_worker")) { if (!DI::config()->get("system", "frontend_worker")) {
return; return;
} }
@ -1000,7 +1000,7 @@ class Worker
if (function_exists("proc_open")) { if (function_exists("proc_open")) {
// When was the last time that we called the worker? // When was the last time that we called the worker?
// Less than one minute? Then we quit // Less than one minute? Then we quit
if ((time() - Config::get("system", "worker_started")) < 60) { if ((time() - DI::config()->get("system", "worker_started")) < 60) {
return; return;
} }
@ -1044,7 +1044,7 @@ class Worker
*/ */
public static function clearProcesses() public static function clearProcesses()
{ {
$timeout = Config::get("system", "frontend_worker_timeout", 10); $timeout = DI::config()->get("system", "frontend_worker_timeout", 10);
/// @todo We should clean up the corresponding workerqueue entries as well /// @todo We should clean up the corresponding workerqueue entries as well
$stamp = (float)microtime(true); $stamp = (float)microtime(true);
@ -1093,7 +1093,7 @@ class Worker
$process->run($command, $args); $process->run($command, $args);
// after spawning we have to remove the flag. // after spawning we have to remove the flag.
if (Config::get('system', 'worker_daemon_mode', false)) { if (DI::config()->get('system', 'worker_daemon_mode', false)) {
self::IPCSetJobState(false); self::IPCSetJobState(false);
} }
} }
@ -1132,7 +1132,7 @@ class Worker
$priority = PRIORITY_MEDIUM; $priority = PRIORITY_MEDIUM;
// Don't fork from frontend tasks by default // Don't fork from frontend tasks by default
$dont_fork = Config::get("system", "worker_dont_fork", false) || !DI::mode()->isBackend(); $dont_fork = DI::config()->get("system", "worker_dont_fork", false) || !DI::mode()->isBackend();
$created = DateTimeFormat::utcNow(); $created = DateTimeFormat::utcNow();
$force_priority = false; $force_priority = false;
@ -1192,7 +1192,7 @@ class Worker
} }
// We tell the daemon that a new job entry exists // We tell the daemon that a new job entry exists
if (Config::get('system', 'worker_daemon_mode', false)) { if (DI::config()->get('system', 'worker_daemon_mode', false)) {
// We don't have to set the IPC flag - this is done in "tooMuchWorkers" // We don't have to set the IPC flag - this is done in "tooMuchWorkers"
return $added; return $added;
} }
@ -1246,7 +1246,7 @@ class Worker
$id = $queue['id']; $id = $queue['id'];
$priority = $queue['priority']; $priority = $queue['priority'];
$max_level = Config::get('system', 'worker_defer_limit'); $max_level = DI::config()->get('system', 'worker_defer_limit');
$new_retrial = self::getNextRetrial($queue, $max_level); $new_retrial = self::getNextRetrial($queue, $max_level);

View file

@ -57,24 +57,24 @@ class PostUpdate
private static function update1194() private static function update1194()
{ {
// Was the script completed? // Was the script completed?
if (Config::get("system", "post_update_version") >= 1194) { if (DI::config()->get("system", "post_update_version") >= 1194) {
return true; return true;
} }
Logger::log("Start", Logger::DEBUG); Logger::log("Start", Logger::DEBUG);
$end_id = Config::get("system", "post_update_1194_end"); $end_id = DI::config()->get("system", "post_update_1194_end");
if (!$end_id) { if (!$end_id) {
$r = q("SELECT `id` FROM `item` WHERE `uid` != 0 ORDER BY `id` DESC LIMIT 1"); $r = q("SELECT `id` FROM `item` WHERE `uid` != 0 ORDER BY `id` DESC LIMIT 1");
if ($r) { if ($r) {
Config::set("system", "post_update_1194_end", $r[0]["id"]); Config::set("system", "post_update_1194_end", $r[0]["id"]);
$end_id = Config::get("system", "post_update_1194_end"); $end_id = DI::config()->get("system", "post_update_1194_end");
} }
} }
Logger::log("End ID: ".$end_id, Logger::DEBUG); Logger::log("End ID: ".$end_id, Logger::DEBUG);
$start_id = Config::get("system", "post_update_1194_start"); $start_id = DI::config()->get("system", "post_update_1194_start");
$query1 = "SELECT `item`.`id` FROM `item` "; $query1 = "SELECT `item`.`id` FROM `item` ";
@ -95,7 +95,7 @@ class PostUpdate
return true; return true;
} else { } else {
Config::set("system", "post_update_1194_start", $r[0]["id"]); Config::set("system", "post_update_1194_start", $r[0]["id"]);
$start_id = Config::get("system", "post_update_1194_start"); $start_id = DI::config()->get("system", "post_update_1194_start");
} }
Logger::log("Start ID: ".$start_id, Logger::DEBUG); Logger::log("Start ID: ".$start_id, Logger::DEBUG);
@ -128,7 +128,7 @@ class PostUpdate
private static function update1206() private static function update1206()
{ {
// Was the script completed? // Was the script completed?
if (Config::get("system", "post_update_version") >= 1206) { if (DI::config()->get("system", "post_update_version") >= 1206) {
return true; return true;
} }
@ -162,11 +162,11 @@ class PostUpdate
private static function update1279() private static function update1279()
{ {
// Was the script completed? // Was the script completed?
if (Config::get("system", "post_update_version") >= 1279) { if (DI::config()->get("system", "post_update_version") >= 1279) {
return true; return true;
} }
$id = Config::get("system", "post_update_version_1279_id", 0); $id = DI::config()->get("system", "post_update_version_1279_id", 0);
Logger::log("Start from item " . $id, Logger::DEBUG); Logger::log("Start from item " . $id, Logger::DEBUG);
@ -313,11 +313,11 @@ class PostUpdate
private static function update1281() private static function update1281()
{ {
// Was the script completed? // Was the script completed?
if (Config::get("system", "post_update_version") >= 1281) { if (DI::config()->get("system", "post_update_version") >= 1281) {
return true; return true;
} }
$id = Config::get("system", "post_update_version_1281_id", 0); $id = DI::config()->get("system", "post_update_version_1281_id", 0);
Logger::log("Start from item " . $id, Logger::DEBUG); Logger::log("Start from item " . $id, Logger::DEBUG);
@ -397,7 +397,7 @@ class PostUpdate
private static function update1297() private static function update1297()
{ {
// Was the script completed? // Was the script completed?
if (Config::get('system', 'post_update_version') >= 1297) { if (DI::config()->get('system', 'post_update_version') >= 1297) {
return true; return true;
} }
@ -432,7 +432,7 @@ class PostUpdate
private static function update1322() private static function update1322()
{ {
// Was the script completed? // Was the script completed?
if (Config::get('system', 'post_update_version') >= 1322) { if (DI::config()->get('system', 'post_update_version') >= 1322) {
return true; return true;
} }
@ -467,11 +467,11 @@ class PostUpdate
private static function update1329() private static function update1329()
{ {
// Was the script completed? // Was the script completed?
if (Config::get('system', 'post_update_version') >= 1329) { if (DI::config()->get('system', 'post_update_version') >= 1329) {
return true; return true;
} }
$id = Config::get('system', 'post_update_version_1329_id', 0); $id = DI::config()->get('system', 'post_update_version_1329_id', 0);
Logger::info('Start', ['item' => $id]); Logger::info('Start', ['item' => $id]);

View file

@ -33,7 +33,7 @@ class APContact
return false; return false;
} }
$xrd_timeout = Config::get('system', 'xrd_timeout'); $xrd_timeout = DI::config()->get('system', 'xrd_timeout');
$webfinger = 'https://' . $addr_parts[1] . '/.well-known/webfinger?resource=acct:' . urlencode($addr); $webfinger = 'https://' . $addr_parts[1] . '/.well-known/webfinger?resource=acct:' . urlencode($addr);

View file

@ -919,7 +919,7 @@ class Contact
*/ */
/// @todo Check for contact vitality via probing /// @todo Check for contact vitality via probing
$archival_days = Config::get('system', 'archival_days', 32); $archival_days = DI::config()->get('system', 'archival_days', 32);
$expiry = $contact['term-date'] . ' + ' . $archival_days . ' days '; $expiry = $contact['term-date'] . ' + ' . $archival_days . ' days ';
if (DateTimeFormat::utcNow() > DateTimeFormat::utc($expiry)) { if (DateTimeFormat::utcNow() > DateTimeFormat::utc($expiry)) {
@ -2322,7 +2322,7 @@ class Contact
// NOTREACHED // NOTREACHED
} }
} elseif (Config::get('system', 'dfrn_only') && ($ret['network'] != Protocol::DFRN)) { } elseif (DI::config()->get('system', 'dfrn_only') && ($ret['network'] != Protocol::DFRN)) {
$result['message'] = DI::l10n()->t('This site is not configured to allow communications with other networks.') . EOL; $result['message'] = DI::l10n()->t('This site is not configured to allow communications with other networks.') . EOL;
$result['message'] .= DI::l10n()->t('No compatible communication protocols or feeds were discovered.') . EOL; $result['message'] .= DI::l10n()->t('No compatible communication protocols or feeds were discovered.') . EOL;
return $result; return $result;
@ -2352,7 +2352,7 @@ class Contact
return $result; return $result;
} }
if ($protocol === Protocol::OSTATUS && Config::get('system', 'ostatus_disabled')) { if ($protocol === Protocol::OSTATUS && DI::config()->get('system', 'ostatus_disabled')) {
$result['message'] .= DI::l10n()->t('The profile address specified belongs to a network which has been disabled on this site.') . EOL; $result['message'] .= DI::l10n()->t('The profile address specified belongs to a network which has been disabled on this site.') . EOL;
$ret['notify'] = ''; $ret['notify'] = '';
} }

View file

@ -43,13 +43,13 @@ class GContact
} }
// check supported networks // check supported networks
if (Config::get('system', 'diaspora_enabled')) { if (DI::config()->get('system', 'diaspora_enabled')) {
$diaspora = Protocol::DIASPORA; $diaspora = Protocol::DIASPORA;
} else { } else {
$diaspora = Protocol::DFRN; $diaspora = Protocol::DFRN;
} }
if (!Config::get('system', 'ostatus_disabled')) { if (!DI::config()->get('system', 'ostatus_disabled')) {
$ostatus = Protocol::OSTATUS; $ostatus = Protocol::OSTATUS;
} else { } else {
$ostatus = Protocol::DFRN; $ostatus = Protocol::DFRN;
@ -424,11 +424,11 @@ class GContact
$network = [Protocol::DFRN, Protocol::ACTIVITYPUB]; $network = [Protocol::DFRN, Protocol::ACTIVITYPUB];
if (Config::get('system', 'diaspora_enabled')) { if (DI::config()->get('system', 'diaspora_enabled')) {
$network[] = Protocol::DIASPORA; $network[] = Protocol::DIASPORA;
} }
if (!Config::get('system', 'ostatus_disabled')) { if (!DI::config()->get('system', 'ostatus_disabled')) {
$network[] = Protocol::OSTATUS; $network[] = Protocol::OSTATUS;
} }
@ -508,7 +508,7 @@ class GContact
$done[] = DI::baseUrl() . '/poco'; $done[] = DI::baseUrl() . '/poco';
if (strlen(Config::get('system', 'directory'))) { if (strlen(DI::config()->get('system', 'directory'))) {
$x = Network::fetchUrl(Search::getGlobalDirectory() . '/pubsites'); $x = Network::fetchUrl(Search::getGlobalDirectory() . '/pubsites');
if (!empty($x)) { if (!empty($x)) {
$j = json_decode($x); $j = json_decode($x);
@ -1235,7 +1235,7 @@ class GContact
*/ */
public static function discoverGsUsers() public static function discoverGsUsers()
{ {
$requery_days = intval(Config::get('system', 'poco_requery_days')); $requery_days = intval(DI::config()->get('system', 'poco_requery_days'));
$last_update = date("c", time() - (60 * 60 * 24 * $requery_days)); $last_update = date("c", time() - (60 * 60 * 24 * $requery_days));

View file

@ -192,7 +192,7 @@ class GServer
} }
// When a nodeinfo is present, we don't need to dig further // When a nodeinfo is present, we don't need to dig further
$xrd_timeout = Config::get('system', 'xrd_timeout'); $xrd_timeout = DI::config()->get('system', 'xrd_timeout');
$curlResult = Network::curl($url . '/.well-known/nodeinfo', false, ['timeout' => $xrd_timeout]); $curlResult = Network::curl($url . '/.well-known/nodeinfo', false, ['timeout' => $xrd_timeout]);
if ($curlResult->isTimeout()) { if ($curlResult->isTimeout()) {
DBA::update('gserver', ['last_failure' => DateTimeFormat::utcNow()], ['nurl' => Strings::normaliseLink($url)]); DBA::update('gserver', ['last_failure' => DateTimeFormat::utcNow()], ['nurl' => Strings::normaliseLink($url)]);
@ -726,7 +726,7 @@ class GServer
*/ */
private static function validHostMeta(string $url) private static function validHostMeta(string $url)
{ {
$xrd_timeout = Config::get('system', 'xrd_timeout'); $xrd_timeout = DI::config()->get('system', 'xrd_timeout');
$curlResult = Network::curl($url . '/.well-known/host-meta', false, ['timeout' => $xrd_timeout]); $curlResult = Network::curl($url . '/.well-known/host-meta', false, ['timeout' => $xrd_timeout]);
if (!$curlResult->isSuccess()) { if (!$curlResult->isSuccess()) {
return false; return false;
@ -1348,7 +1348,7 @@ class GServer
$no_of_queries = 5; $no_of_queries = 5;
$requery_days = intval(Config::get('system', 'poco_requery_days')); $requery_days = intval(DI::config()->get('system', 'poco_requery_days'));
if ($requery_days == 0) { if ($requery_days == 0) {
$requery_days = 7; $requery_days = 7;
@ -1388,7 +1388,7 @@ class GServer
*/ */
private static function discoverFederation() private static function discoverFederation()
{ {
$last = Config::get('poco', 'last_federation_discovery'); $last = DI::config()->get('poco', 'last_federation_discovery');
if ($last) { if ($last) {
$next = $last + (24 * 60 * 60); $next = $last + (24 * 60 * 60);
@ -1412,7 +1412,7 @@ class GServer
} }
// Disvover Mastodon servers // Disvover Mastodon servers
$accesstoken = Config::get('system', 'instances_social_key'); $accesstoken = DI::config()->get('system', 'instances_social_key');
if (!empty($accesstoken)) { if (!empty($accesstoken)) {
$api = 'https://instances.social/api/1.0/instances/list?count=0'; $api = 'https://instances.social/api/1.0/instances/list?count=0';

View file

@ -104,7 +104,7 @@ class Item
public static function isLegacyMode() public static function isLegacyMode()
{ {
if (is_null(self::$legacy_mode)) { if (is_null(self::$legacy_mode)) {
self::$legacy_mode = (Config::get("system", "post_update_version") < 1279); self::$legacy_mode = (DI::config()->get("system", "post_update_version") < 1279);
} }
return self::$legacy_mode; return self::$legacy_mode;
@ -1451,7 +1451,7 @@ class Item
$uid = intval($item['uid']); $uid = intval($item['uid']);
// check for create date and expire time // check for create date and expire time
$expire_interval = Config::get('system', 'dbclean-expire-days', 0); $expire_interval = DI::config()->get('system', 'dbclean-expire-days', 0);
$user = DBA::selectFirst('user', ['expire'], ['uid' => $uid]); $user = DBA::selectFirst('user', ['expire'], ['uid' => $uid]);
if (DBA::isResult($user) && ($user['expire'] > 0) && (($user['expire'] < $expire_interval) || ($expire_interval == 0))) { if (DBA::isResult($user) && ($user['expire'] > 0) && (($user['expire'] < $expire_interval) || ($expire_interval == 0))) {
@ -1879,7 +1879,7 @@ class Item
unset($item['owner-name']); unset($item['owner-name']);
unset($item['owner-avatar']); unset($item['owner-avatar']);
$like_no_comment = Config::get('system', 'like_no_comment'); $like_no_comment = DI::config()->get('system', 'like_no_comment');
DBA::transaction(); DBA::transaction();
$ret = DBA::insert('item', $item); $ret = DBA::insert('item', $item);
@ -2585,7 +2585,7 @@ class Item
$URLSearchString = "^\[\]"; $URLSearchString = "^\[\]";
// All hashtags should point to the home server if "local_tags" is activated // All hashtags should point to the home server if "local_tags" is activated
if (Config::get('system', 'local_tags')) { if (DI::config()->get('system', 'local_tags')) {
$item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", $item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
"#[url=".DI::baseUrl()."/search?tag=$2]$2[/url]", $item["body"]); "#[url=".DI::baseUrl()."/search?tag=$2]$2[/url]", $item["body"]);
@ -2842,7 +2842,7 @@ class Item
*/ */
public static function fixPrivatePhotos($s, $uid, $item = null, $cid = 0) public static function fixPrivatePhotos($s, $uid, $item = null, $cid = 0)
{ {
if (Config::get('system', 'disable_embedded')) { if (DI::config()->get('system', 'disable_embedded')) {
return $s; return $s;
} }
@ -3420,7 +3420,7 @@ class Item
if ($rendered_hash == '' if ($rendered_hash == ''
|| $rendered_html == "" || $rendered_html == ""
|| $rendered_hash != hash("md5", $item["body"]) || $rendered_hash != hash("md5", $item["body"])
|| Config::get("system", "ignore_cache") || DI::config()->get("system", "ignore_cache")
) { ) {
self::addRedirToImageTags($item); self::addRedirToImageTags($item);
@ -3439,7 +3439,7 @@ class Item
} }
// Only compare the HTML when we forcefully ignore the cache // Only compare the HTML when we forcefully ignore the cache
if (Config::get("system", "ignore_cache") && ($rendered_html != $item["rendered-html"])) { if (DI::config()->get("system", "ignore_cache") && ($rendered_html != $item["rendered-html"])) {
$update = true; $update = true;
} }

View file

@ -541,7 +541,7 @@ class Photo
$key = "photo_albums:".$uid.":".local_user().":".remote_user(); $key = "photo_albums:".$uid.":".local_user().":".remote_user();
$albums = DI::cache()->get($key); $albums = DI::cache()->get($key);
if (is_null($albums) || $update) { if (is_null($albums) || $update) {
if (!Config::get("system", "no_count", false)) { if (!DI::config()->get("system", "no_count", false)) {
/// @todo This query needs to be renewed. It is really slow /// @todo This query needs to be renewed. It is really slow
// At this time we just store the data in the cache // At this time we just store the data in the cache
$albums = q("SELECT COUNT(DISTINCT `resource-id`) AS `total`, `album`, ANY_VALUE(`created`) AS `created` $albums = q("SELECT COUNT(DISTINCT `resource-id`) AS `total`, `album`, ANY_VALUE(`created`) AS `created`

View file

@ -183,7 +183,7 @@ class Profile
$a->profile['mobile-theme'] = DI::pConfig()->get($a->profile['profile_uid'], 'system', 'mobile_theme'); $a->profile['mobile-theme'] = DI::pConfig()->get($a->profile['profile_uid'], 'system', 'mobile_theme');
$a->profile['network'] = Protocol::DFRN; $a->profile['network'] = Protocol::DFRN;
DI::page()['title'] = $a->profile['name'] . ' @ ' . Config::get('config', 'sitename'); DI::page()['title'] = $a->profile['name'] . ' @ ' . DI::config()->get('config', 'sitename');
if (!$profiledata && !DI::pConfig()->get(local_user(), 'system', 'always_my_theme')) { if (!$profiledata && !DI::pConfig()->get(local_user(), 'system', 'always_my_theme')) {
$a->setCurrentTheme($a->profile['theme']); $a->setCurrentTheme($a->profile['theme']);
@ -211,7 +211,7 @@ class Profile
); );
} }
$block = ((Config::get('system', 'block_public') && !Session::isAuthenticated()) ? true : false); $block = ((DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) ? true : false);
/** /**
* @todo * @todo
@ -1231,7 +1231,7 @@ class Profile
*/ */
public static function searchProfiles($start = 0, $count = 100, $search = null) public static function searchProfiles($start = 0, $count = 100, $search = null)
{ {
$publish = (Config::get('system', 'publish_all') ? '' : " AND `publish` = 1 "); $publish = (DI::config()->get('system', 'publish_all') ? '' : " AND `publish` = 1 ");
$total = 0; $total = 0;
if (!empty($search)) { if (!empty($search)) {

View file

@ -501,7 +501,7 @@ class User
throw new Exception(DI::l10n()->t('Empty passwords are not allowed.')); throw new Exception(DI::l10n()->t('Empty passwords are not allowed.'));
} }
if (!Config::get('system', 'disable_password_exposed', false) && self::isPasswordExposed($password)) { if (!DI::config()->get('system', 'disable_password_exposed', false) && self::isPasswordExposed($password)) {
throw new Exception(DI::l10n()->t('The new password has been exposed in a public data dump, please choose another.')); throw new Exception(DI::l10n()->t('The new password has been exposed in a public data dump, please choose another.'));
} }
@ -547,7 +547,7 @@ class User
*/ */
public static function isNicknameBlocked($nickname) public static function isNicknameBlocked($nickname)
{ {
$forbidden_nicknames = Config::get('system', 'forbidden_nicknames', ''); $forbidden_nicknames = DI::config()->get('system', 'forbidden_nicknames', '');
// if the config variable is empty return false // if the config variable is empty return false
if (empty($forbidden_nicknames)) { if (empty($forbidden_nicknames)) {
@ -588,7 +588,7 @@ class User
{ {
$return = ['user' => null, 'password' => '']; $return = ['user' => null, 'password' => ''];
$using_invites = Config::get('system', 'invitation_only'); $using_invites = DI::config()->get('system', 'invitation_only');
$invite_id = !empty($data['invite_id']) ? Strings::escapeTags(trim($data['invite_id'])) : ''; $invite_id = !empty($data['invite_id']) ? Strings::escapeTags(trim($data['invite_id'])) : '';
$username = !empty($data['username']) ? Strings::escapeTags(trim($data['username'])) : ''; $username = !empty($data['username']) ? Strings::escapeTags(trim($data['username'])) : '';
@ -604,7 +604,7 @@ class User
$language = !empty($data['language']) ? Strings::escapeTags(trim($data['language'])) : 'en'; $language = !empty($data['language']) ? Strings::escapeTags(trim($data['language'])) : 'en';
$publish = !empty($data['profile_publish_reg']); $publish = !empty($data['profile_publish_reg']);
$netpublish = $publish && Config::get('system', 'directory'); $netpublish = $publish && DI::config()->get('system', 'directory');
if ($password1 != $confirm) { if ($password1 != $confirm) {
throw new Exception(DI::l10n()->t('Passwords do not match. Password unchanged.')); throw new Exception(DI::l10n()->t('Passwords do not match. Password unchanged.'));
@ -655,8 +655,8 @@ class User
// collapse multiple spaces in name // collapse multiple spaces in name
$username = preg_replace('/ +/', ' ', $username); $username = preg_replace('/ +/', ' ', $username);
$username_min_length = max(1, min(64, intval(Config::get('system', 'username_min_length', 3)))); $username_min_length = max(1, min(64, intval(DI::config()->get('system', 'username_min_length', 3))));
$username_max_length = max(1, min(64, intval(Config::get('system', 'username_max_length', 48)))); $username_max_length = max(1, min(64, intval(DI::config()->get('system', 'username_max_length', 48))));
if ($username_min_length > $username_max_length) { if ($username_min_length > $username_max_length) {
Logger::log(DI::l10n()->t('system.username_min_length (%s) and system.username_max_length (%s) are excluding each other, swapping values.', $username_min_length, $username_max_length), Logger::WARNING); Logger::log(DI::l10n()->t('system.username_min_length (%s) and system.username_max_length (%s) are excluding each other, swapping values.', $username_min_length, $username_max_length), Logger::WARNING);
@ -674,7 +674,7 @@ class User
} }
// So now we are just looking for a space in the full name. // So now we are just looking for a space in the full name.
$loose_reg = Config::get('system', 'no_regfullname'); $loose_reg = DI::config()->get('system', 'no_regfullname');
if (!$loose_reg) { if (!$loose_reg) {
$username = mb_convert_case($username, MB_CASE_TITLE, 'UTF-8'); $username = mb_convert_case($username, MB_CASE_TITLE, 'UTF-8');
if (strpos($username, ' ') === false) { if (strpos($username, ' ') === false) {
@ -693,14 +693,14 @@ class User
throw new Exception(DI::l10n()->t('The nickname was blocked from registration by the nodes admin.')); throw new Exception(DI::l10n()->t('The nickname was blocked from registration by the nodes admin.'));
} }
if (Config::get('system', 'block_extended_register', false) && DBA::exists('user', ['email' => $email])) { if (DI::config()->get('system', 'block_extended_register', false) && DBA::exists('user', ['email' => $email])) {
throw new Exception(DI::l10n()->t('Cannot use that email.')); throw new Exception(DI::l10n()->t('Cannot use that email.'));
} }
// Disallow somebody creating an account using openid that uses the admin email address, // Disallow somebody creating an account using openid that uses the admin email address,
// since openid bypasses email verification. We'll allow it if there is not yet an admin account. // since openid bypasses email verification. We'll allow it if there is not yet an admin account.
if (Config::get('config', 'admin_email') && strlen($openid_url)) { if (DI::config()->get('config', 'admin_email') && strlen($openid_url)) {
$adminlist = explode(',', str_replace(' ', '', strtolower(Config::get('config', 'admin_email')))); $adminlist = explode(',', str_replace(' ', '', strtolower(DI::config()->get('config', 'admin_email'))));
if (in_array(strtolower($email), $adminlist)) { if (in_array(strtolower($email), $adminlist)) {
throw new Exception(DI::l10n()->t('Cannot use that email.')); throw new Exception(DI::l10n()->t('Cannot use that email.'));
} }
@ -810,7 +810,7 @@ class User
} }
$fields = ['def_gid' => $def_gid]; $fields = ['def_gid' => $def_gid];
if (Config::get('system', 'newuser_private') && $def_gid) { if (DI::config()->get('system', 'newuser_private') && $def_gid) {
$fields['allow_gid'] = '<' . $def_gid . '>'; $fields['allow_gid'] = '<' . $def_gid . '>';
} }

View file

@ -22,7 +22,7 @@ class Server extends BaseAdminModule
if (!empty($_POST['page_blocklist_save'])) { if (!empty($_POST['page_blocklist_save'])) {
// Add new item to blocklist // Add new item to blocklist
$blocklist = Config::get('system', 'blocklist'); $blocklist = DI::config()->get('system', 'blocklist');
$blocklist[] = [ $blocklist[] = [
'domain' => Strings::escapeTags(trim($_POST['newentry_domain'])), 'domain' => Strings::escapeTags(trim($_POST['newentry_domain'])),
'reason' => Strings::escapeTags(trim($_POST['newentry_reason'])) 'reason' => Strings::escapeTags(trim($_POST['newentry_reason']))
@ -54,7 +54,7 @@ class Server extends BaseAdminModule
{ {
parent::content($parameters); parent::content($parameters);
$blocklist = Config::get('system', 'blocklist'); $blocklist = DI::config()->get('system', 'blocklist');
$blocklistform = []; $blocklistform = [];
if (is_array($blocklist)) { if (is_array($blocklist)) {
foreach ($blocklist as $id => $b) { foreach ($blocklist as $id => $b) {

View file

@ -25,7 +25,7 @@ class DBSync extends BaseAdminModule
$update = intval($a->argv[3]); $update = intval($a->argv[3]);
if ($update) { if ($update) {
Config::set('database', 'update_' . $update, 'success'); Config::set('database', 'update_' . $update, 'success');
$curr = Config::get('system', 'build'); $curr = DI::config()->get('system', 'build');
if (intval($curr) == $update) { if (intval($curr) == $update) {
Config::set('system', 'build', intval($curr) + 1); Config::set('system', 'build', intval($curr) + 1);
} }

View file

@ -53,7 +53,7 @@ class Features extends BaseAdminModule
$arr[$fname] = []; $arr[$fname] = [];
$arr[$fname][0] = $fdata[0]; $arr[$fname][0] = $fdata[0];
foreach (array_slice($fdata, 1) as $f) { foreach (array_slice($fdata, 1) as $f) {
$set = Config::get('feature', $f[0], $f[3]); $set = DI::config()->get('feature', $f[0], $f[3]);
$arr[$fname][1][] = [ $arr[$fname][1][] = [
['feature_' . $f[0], $f[1], $set, $f[2], [DI::l10n()->t('Off'), DI::l10n()->t('On')]], ['feature_' . $f[0], $f[1], $set, $f[2], [DI::l10n()->t('Off'), DI::l10n()->t('On')]],
['featurelock_' . $f[0], DI::l10n()->t('Lock feature %s', $f[1]), (($f[4] !== false) ? "1" : ''), '', [DI::l10n()->t('Off'), DI::l10n()->t('On')]] ['featurelock_' . $f[0], DI::l10n()->t('Lock feature %s', $f[1]), (($f[4] !== false) ? "1" : ''), '', [DI::l10n()->t('Off'), DI::l10n()->t('On')]]

View file

@ -123,7 +123,7 @@ class Federation extends BaseAdminModule
'$page' => DI::l10n()->t('Federation Statistics'), '$page' => DI::l10n()->t('Federation Statistics'),
'$intro' => $intro, '$intro' => $intro,
'$hint' => $hint, '$hint' => $hint,
'$autoactive' => Config::get('system', 'poco_completion'), '$autoactive' => DI::config()->get('system', 'poco_completion'),
'$counts' => $counts, '$counts' => $counts,
'$version' => FRIENDICA_VERSION, '$version' => FRIENDICA_VERSION,
'$legendtext' => DI::l10n()->t('Currently this node is aware of %d nodes with %d registered users from the following platforms:', $total, $users), '$legendtext' => DI::l10n()->t('Currently this node is aware of %d nodes with %d registered users from the following platforms:', $total, $users),

View file

@ -63,11 +63,11 @@ class Settings extends BaseAdminModule
'$submit' => DI::l10n()->t('Save Settings'), '$submit' => DI::l10n()->t('Save Settings'),
'$clear' => DI::l10n()->t('Clear'), '$clear' => DI::l10n()->t('Clear'),
'$baseurl' => DI::baseUrl()->get(true), '$baseurl' => DI::baseUrl()->get(true),
'$logname' => Config::get('system', 'logfile'), '$logname' => DI::config()->get('system', 'logfile'),
// see /help/smarty3-templates#1_1 on any Friendica node // see /help/smarty3-templates#1_1 on any Friendica node
'$debugging' => ['debugging', DI::l10n()->t("Enable Debugging"), Config::get('system', 'debugging'), ""], '$debugging' => ['debugging', DI::l10n()->t("Enable Debugging"), DI::config()->get('system', 'debugging'), ""],
'$logfile' => ['logfile', DI::l10n()->t("Log file"), Config::get('system', 'logfile'), DI::l10n()->t("Must be writable by web server. Relative to your Friendica top-level directory.")], '$logfile' => ['logfile', DI::l10n()->t("Log file"), DI::config()->get('system', 'logfile'), DI::l10n()->t("Must be writable by web server. Relative to your Friendica top-level directory.")],
'$loglevel' => ['loglevel', DI::l10n()->t("Log level"), Config::get('system', 'loglevel'), "", $log_choices], '$loglevel' => ['loglevel', DI::l10n()->t("Log level"), DI::config()->get('system', 'loglevel'), "", $log_choices],
'$form_security_token' => parent::getFormSecurityToken("admin_logs"), '$form_security_token' => parent::getFormSecurityToken("admin_logs"),
'$phpheader' => DI::l10n()->t("PHP logging"), '$phpheader' => DI::l10n()->t("PHP logging"),
'$phphint' => DI::l10n()->t("To temporarily enable logging of PHP errors and warnings you can prepend the following to the index.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."), '$phphint' => DI::l10n()->t("To temporarily enable logging of PHP errors and warnings you can prepend the following to the index.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."),

View file

@ -15,7 +15,7 @@ class View extends BaseAdminModule
parent::content($parameters); parent::content($parameters);
$t = Renderer::getMarkupTemplate('admin/logs/view.tpl'); $t = Renderer::getMarkupTemplate('admin/logs/view.tpl');
$f = Config::get('system', 'logfile'); $f = DI::config()->get('system', 'logfile');
$data = ''; $data = '';
if (!file_exists($f)) { if (!file_exists($f)) {
@ -46,7 +46,7 @@ class View extends BaseAdminModule
'$title' => DI::l10n()->t('Administration'), '$title' => DI::l10n()->t('Administration'),
'$page' => DI::l10n()->t('View Logs'), '$page' => DI::l10n()->t('View Logs'),
'$data' => $data, '$data' => $data,
'$logname' => Config::get('system', 'logfile') '$logname' => DI::config()->get('system', 'logfile')
]); ]);
} }
} }

View file

@ -231,7 +231,7 @@ class Site extends BaseAdminModule
} }
// Has the directory url changed? If yes, then resubmit the existing profiles there // Has the directory url changed? If yes, then resubmit the existing profiles there
if ($global_directory != Config::get('system', 'directory') && ($global_directory != '')) { if ($global_directory != DI::config()->get('system', 'directory') && ($global_directory != '')) {
Config::set('system', 'directory', $global_directory); Config::set('system', 'directory', $global_directory);
Worker::add(PRIORITY_LOW, 'Directory'); Worker::add(PRIORITY_LOW, 'Directory');
} }
@ -239,7 +239,7 @@ class Site extends BaseAdminModule
if (DI::baseUrl()->getUrlPath() != "") { if (DI::baseUrl()->getUrlPath() != "") {
$diaspora_enabled = false; $diaspora_enabled = false;
} }
if ($ssl_policy != intval(Config::get('system', 'ssl_policy'))) { if ($ssl_policy != intval(DI::config()->get('system', 'ssl_policy'))) {
if ($ssl_policy == App\BaseURL::SSL_POLICY_FULL) { if ($ssl_policy == App\BaseURL::SSL_POLICY_FULL) {
DBA::e("UPDATE `contact` SET DBA::e("UPDATE `contact` SET
`url` = REPLACE(`url` , 'http:' , 'https:'), `url` = REPLACE(`url` , 'http:' , 'https:'),
@ -414,9 +414,9 @@ class Site extends BaseAdminModule
/* Installed langs */ /* Installed langs */
$lang_choices = DI::l10n()->getAvailableLanguages(); $lang_choices = DI::l10n()->getAvailableLanguages();
if (strlen(Config::get('system', 'directory_submit_url')) && if (strlen(DI::config()->get('system', 'directory_submit_url')) &&
!strlen(Config::get('system', 'directory'))) { !strlen(DI::config()->get('system', 'directory'))) {
Config::set('system', 'directory', dirname(Config::get('system', 'directory_submit_url'))); Config::set('system', 'directory', dirname(DI::config()->get('system', 'directory_submit_url')));
Config::delete('system', 'directory_submit_url'); Config::delete('system', 'directory_submit_url');
} }
@ -426,7 +426,7 @@ class Site extends BaseAdminModule
$theme_choices_mobile['---'] = DI::l10n()->t('No special theme for mobile devices'); $theme_choices_mobile['---'] = DI::l10n()->t('No special theme for mobile devices');
$files = glob('view/theme/*'); $files = glob('view/theme/*');
if (is_array($files)) { if (is_array($files)) {
$allowed_theme_list = Config::get('system', 'allowed_themes'); $allowed_theme_list = DI::config()->get('system', 'allowed_themes');
foreach ($files as $file) { foreach ($files as $file) {
if (intval(file_exists($file . '/unsupported'))) { if (intval(file_exists($file . '/unsupported'))) {
@ -484,13 +484,13 @@ class Site extends BaseAdminModule
} }
/* Banner */ /* Banner */
$banner = Config::get('system', 'banner'); $banner = DI::config()->get('system', 'banner');
if ($banner == false) { if ($banner == false) {
$banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>'; $banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
} }
$additional_info = Config::get('config', 'info'); $additional_info = DI::config()->get('config', 'info');
// Automatically create temporary paths // Automatically create temporary paths
get_temppath(); get_temppath();
@ -517,7 +517,7 @@ class Site extends BaseAdminModule
$diaspora_able = (DI::baseUrl()->getUrlPath() == ''); $diaspora_able = (DI::baseUrl()->getUrlPath() == '');
$optimize_max_tablesize = Config::get('system', 'optimize_max_tablesize', -1); $optimize_max_tablesize = DI::config()->get('system', 'optimize_max_tablesize', -1);
if ($optimize_max_tablesize <= 0) { if ($optimize_max_tablesize <= 0) {
$optimize_max_tablesize = -1; $optimize_max_tablesize = -1;
@ -569,101 +569,101 @@ class Site extends BaseAdminModule
'$baseurl' => DI::baseUrl()->get(true), '$baseurl' => DI::baseUrl()->get(true),
// name, label, value, help string, extra data... // name, label, value, help string, extra data...
'$sitename' => ['sitename', DI::l10n()->t('Site name'), Config::get('config', 'sitename'), ''], '$sitename' => ['sitename', DI::l10n()->t('Site name'), DI::config()->get('config', 'sitename'), ''],
'$sender_email' => ['sender_email', DI::l10n()->t('Sender Email'), Config::get('config', 'sender_email'), DI::l10n()->t('The email address your server shall use to send notification emails from.'), '', '', 'email'], '$sender_email' => ['sender_email', DI::l10n()->t('Sender Email'), DI::config()->get('config', 'sender_email'), DI::l10n()->t('The email address your server shall use to send notification emails from.'), '', '', 'email'],
'$banner' => ['banner', DI::l10n()->t('Banner/Logo'), $banner, ''], '$banner' => ['banner', DI::l10n()->t('Banner/Logo'), $banner, ''],
'$shortcut_icon' => ['shortcut_icon', DI::l10n()->t('Shortcut icon'), Config::get('system', 'shortcut_icon'), DI::l10n()->t('Link to an icon that will be used for browsers.')], '$shortcut_icon' => ['shortcut_icon', DI::l10n()->t('Shortcut icon'), DI::config()->get('system', 'shortcut_icon'), DI::l10n()->t('Link to an icon that will be used for browsers.')],
'$touch_icon' => ['touch_icon', DI::l10n()->t('Touch icon'), Config::get('system', 'touch_icon'), DI::l10n()->t('Link to an icon that will be used for tablets and mobiles.')], '$touch_icon' => ['touch_icon', DI::l10n()->t('Touch icon'), DI::config()->get('system', 'touch_icon'), DI::l10n()->t('Link to an icon that will be used for tablets and mobiles.')],
'$additional_info' => ['additional_info', DI::l10n()->t('Additional Info'), $additional_info, DI::l10n()->t('For public servers: you can add additional information here that will be listed at %s/servers.', Search::getGlobalDirectory())], '$additional_info' => ['additional_info', DI::l10n()->t('Additional Info'), $additional_info, DI::l10n()->t('For public servers: you can add additional information here that will be listed at %s/servers.', Search::getGlobalDirectory())],
'$language' => ['language', DI::l10n()->t('System language'), Config::get('system', 'language'), '', $lang_choices], '$language' => ['language', DI::l10n()->t('System language'), DI::config()->get('system', 'language'), '', $lang_choices],
'$theme' => ['theme', DI::l10n()->t('System theme'), Config::get('system', 'theme'), DI::l10n()->t('Default system theme - may be over-ridden by user profiles - <a href="/admin/themes" id="cnftheme">Change default theme settings</a>'), $theme_choices], '$theme' => ['theme', DI::l10n()->t('System theme'), DI::config()->get('system', 'theme'), DI::l10n()->t('Default system theme - may be over-ridden by user profiles - <a href="/admin/themes" id="cnftheme">Change default theme settings</a>'), $theme_choices],
'$theme_mobile' => ['theme_mobile', DI::l10n()->t('Mobile system theme'), Config::get('system', 'mobile-theme', '---'), DI::l10n()->t('Theme for mobile devices'), $theme_choices_mobile], '$theme_mobile' => ['theme_mobile', DI::l10n()->t('Mobile system theme'), DI::config()->get('system', 'mobile-theme', '---'), DI::l10n()->t('Theme for mobile devices'), $theme_choices_mobile],
'$ssl_policy' => ['ssl_policy', DI::l10n()->t('SSL link policy'), (string)intval(Config::get('system', 'ssl_policy')), DI::l10n()->t('Determines whether generated links should be forced to use SSL'), $ssl_choices], '$ssl_policy' => ['ssl_policy', DI::l10n()->t('SSL link policy'), (string)intval(DI::config()->get('system', 'ssl_policy')), DI::l10n()->t('Determines whether generated links should be forced to use SSL'), $ssl_choices],
'$force_ssl' => ['force_ssl', DI::l10n()->t('Force SSL'), Config::get('system', 'force_ssl'), DI::l10n()->t('Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.')], '$force_ssl' => ['force_ssl', DI::l10n()->t('Force SSL'), DI::config()->get('system', 'force_ssl'), DI::l10n()->t('Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.')],
'$hide_help' => ['hide_help', DI::l10n()->t('Hide help entry from navigation menu'), Config::get('system', 'hide_help'), DI::l10n()->t('Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.')], '$hide_help' => ['hide_help', DI::l10n()->t('Hide help entry from navigation menu'), DI::config()->get('system', 'hide_help'), DI::l10n()->t('Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.')],
'$singleuser' => ['singleuser', DI::l10n()->t('Single user instance'), Config::get('system', 'singleuser', '---'), DI::l10n()->t('Make this instance multi-user or single-user for the named user'), $user_names], '$singleuser' => ['singleuser', DI::l10n()->t('Single user instance'), DI::config()->get('system', 'singleuser', '---'), DI::l10n()->t('Make this instance multi-user or single-user for the named user'), $user_names],
'$storagebackend' => ['storagebackend', DI::l10n()->t('File storage backend'), $current_storage_backend, DI::l10n()->t('The backend used to store uploaded data. If you change the storage backend, you can manually move the existing files. If you do not do so, the files uploaded before the change will still be available at the old backend. Please see <a href="/help/Settings#1_2_3_1">the settings documentation</a> for more information about the choices and the moving procedure.'), $available_storage_backends], '$storagebackend' => ['storagebackend', DI::l10n()->t('File storage backend'), $current_storage_backend, DI::l10n()->t('The backend used to store uploaded data. If you change the storage backend, you can manually move the existing files. If you do not do so, the files uploaded before the change will still be available at the old backend. Please see <a href="/help/Settings#1_2_3_1">the settings documentation</a> for more information about the choices and the moving procedure.'), $available_storage_backends],
'$storageform' => $storage_form, '$storageform' => $storage_form,
'$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), Config::get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits.')], '$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), DI::config()->get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits.')],
'$maximagelength' => ['maximagelength', DI::l10n()->t('Maximum image length'), Config::get('system', 'max_image_length'), DI::l10n()->t('Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.')], '$maximagelength' => ['maximagelength', DI::l10n()->t('Maximum image length'), DI::config()->get('system', 'max_image_length'), DI::l10n()->t('Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.')],
'$jpegimagequality' => ['jpegimagequality', DI::l10n()->t('JPEG image quality'), Config::get('system', 'jpeg_quality'), DI::l10n()->t('Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.')], '$jpegimagequality' => ['jpegimagequality', DI::l10n()->t('JPEG image quality'), DI::config()->get('system', 'jpeg_quality'), DI::l10n()->t('Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.')],
'$register_policy' => ['register_policy', DI::l10n()->t('Register policy'), Config::get('config', 'register_policy'), '', $register_choices], '$register_policy' => ['register_policy', DI::l10n()->t('Register policy'), DI::config()->get('config', 'register_policy'), '', $register_choices],
'$daily_registrations' => ['max_daily_registrations', DI::l10n()->t('Maximum Daily Registrations'), Config::get('system', 'max_daily_registrations'), DI::l10n()->t('If registration is permitted above, this sets the maximum number of new user registrations to accept per day. If register is set to closed, this setting has no effect.')], '$daily_registrations' => ['max_daily_registrations', DI::l10n()->t('Maximum Daily Registrations'), DI::config()->get('system', 'max_daily_registrations'), DI::l10n()->t('If registration is permitted above, this sets the maximum number of new user registrations to accept per day. If register is set to closed, this setting has no effect.')],
'$register_text' => ['register_text', DI::l10n()->t('Register text'), Config::get('config', 'register_text'), DI::l10n()->t('Will be displayed prominently on the registration page. You can use BBCode here.')], '$register_text' => ['register_text', DI::l10n()->t('Register text'), DI::config()->get('config', 'register_text'), DI::l10n()->t('Will be displayed prominently on the registration page. You can use BBCode here.')],
'$forbidden_nicknames' => ['forbidden_nicknames', DI::l10n()->t('Forbidden Nicknames'), Config::get('system', 'forbidden_nicknames'), DI::l10n()->t('Comma separated list of nicknames that are forbidden from registration. Preset is a list of role names according RFC 2142.')], '$forbidden_nicknames' => ['forbidden_nicknames', DI::l10n()->t('Forbidden Nicknames'), DI::config()->get('system', 'forbidden_nicknames'), DI::l10n()->t('Comma separated list of nicknames that are forbidden from registration. Preset is a list of role names according RFC 2142.')],
'$abandon_days' => ['abandon_days', DI::l10n()->t('Accounts abandoned after x days'), Config::get('system', 'account_abandon_days'), DI::l10n()->t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')], '$abandon_days' => ['abandon_days', DI::l10n()->t('Accounts abandoned after x days'), DI::config()->get('system', 'account_abandon_days'), DI::l10n()->t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')],
'$allowed_sites' => ['allowed_sites', DI::l10n()->t('Allowed friend domains'), Config::get('system', 'allowed_sites'), DI::l10n()->t('Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains')], '$allowed_sites' => ['allowed_sites', DI::l10n()->t('Allowed friend domains'), DI::config()->get('system', 'allowed_sites'), DI::l10n()->t('Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains')],
'$allowed_email' => ['allowed_email', DI::l10n()->t('Allowed email domains'), Config::get('system', 'allowed_email'), DI::l10n()->t('Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains')], '$allowed_email' => ['allowed_email', DI::l10n()->t('Allowed email domains'), DI::config()->get('system', 'allowed_email'), DI::l10n()->t('Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains')],
'$no_oembed_rich_content' => ['no_oembed_rich_content', DI::l10n()->t('No OEmbed rich content'), Config::get('system', 'no_oembed_rich_content'), DI::l10n()->t('Don\'t show the rich content (e.g. embedded PDF), except from the domains listed below.')], '$no_oembed_rich_content' => ['no_oembed_rich_content', DI::l10n()->t('No OEmbed rich content'), DI::config()->get('system', 'no_oembed_rich_content'), DI::l10n()->t('Don\'t show the rich content (e.g. embedded PDF), except from the domains listed below.')],
'$allowed_oembed' => ['allowed_oembed', DI::l10n()->t('Allowed OEmbed domains'), Config::get('system', 'allowed_oembed'), DI::l10n()->t('Comma separated list of domains which oembed content is allowed to be displayed. Wildcards are accepted.')], '$allowed_oembed' => ['allowed_oembed', DI::l10n()->t('Allowed OEmbed domains'), DI::config()->get('system', 'allowed_oembed'), DI::l10n()->t('Comma separated list of domains which oembed content is allowed to be displayed. Wildcards are accepted.')],
'$block_public' => ['block_public', DI::l10n()->t('Block public'), Config::get('system', 'block_public'), DI::l10n()->t('Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.')], '$block_public' => ['block_public', DI::l10n()->t('Block public'), DI::config()->get('system', 'block_public'), DI::l10n()->t('Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.')],
'$force_publish' => ['publish_all', DI::l10n()->t('Force publish'), Config::get('system', 'publish_all'), DI::l10n()->t('Check to force all profiles on this site to be listed in the site directory.') . '<strong>' . DI::l10n()->t('Enabling this may violate privacy laws like the GDPR') . '</strong>'], '$force_publish' => ['publish_all', DI::l10n()->t('Force publish'), DI::config()->get('system', 'publish_all'), DI::l10n()->t('Check to force all profiles on this site to be listed in the site directory.') . '<strong>' . DI::l10n()->t('Enabling this may violate privacy laws like the GDPR') . '</strong>'],
'$global_directory' => ['directory', DI::l10n()->t('Global directory URL'), Config::get('system', 'directory', 'https://dir.friendica.social'), DI::l10n()->t('URL to the global directory. If this is not set, the global directory is completely unavailable to the application.')], '$global_directory' => ['directory', DI::l10n()->t('Global directory URL'), DI::config()->get('system', 'directory', 'https://dir.friendica.social'), DI::l10n()->t('URL to the global directory. If this is not set, the global directory is completely unavailable to the application.')],
'$newuser_private' => ['newuser_private', DI::l10n()->t('Private posts by default for new users'), Config::get('system', 'newuser_private'), DI::l10n()->t('Set default post permissions for all new members to the default privacy group rather than public.')], '$newuser_private' => ['newuser_private', DI::l10n()->t('Private posts by default for new users'), DI::config()->get('system', 'newuser_private'), DI::l10n()->t('Set default post permissions for all new members to the default privacy group rather than public.')],
'$enotify_no_content' => ['enotify_no_content', DI::l10n()->t('Don\'t include post content in email notifications'), Config::get('system', 'enotify_no_content'), DI::l10n()->t('Don\'t include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.')], '$enotify_no_content' => ['enotify_no_content', DI::l10n()->t('Don\'t include post content in email notifications'), DI::config()->get('system', 'enotify_no_content'), DI::l10n()->t('Don\'t include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.')],
'$private_addons' => ['private_addons', DI::l10n()->t('Disallow public access to addons listed in the apps menu.'), Config::get('config', 'private_addons'), DI::l10n()->t('Checking this box will restrict addons listed in the apps menu to members only.')], '$private_addons' => ['private_addons', DI::l10n()->t('Disallow public access to addons listed in the apps menu.'), DI::config()->get('config', 'private_addons'), DI::l10n()->t('Checking this box will restrict addons listed in the apps menu to members only.')],
'$disable_embedded' => ['disable_embedded', DI::l10n()->t('Don\'t embed private images in posts'), Config::get('system', 'disable_embedded'), DI::l10n()->t('Don\'t replace locally-hosted private photos in posts with an embedded copy of the image. This means that contacts who receive posts containing private photos will have to authenticate and load each image, which may take a while.')], '$disable_embedded' => ['disable_embedded', DI::l10n()->t('Don\'t embed private images in posts'), DI::config()->get('system', 'disable_embedded'), DI::l10n()->t('Don\'t replace locally-hosted private photos in posts with an embedded copy of the image. This means that contacts who receive posts containing private photos will have to authenticate and load each image, which may take a while.')],
'$explicit_content' => ['explicit_content', DI::l10n()->t('Explicit Content'), Config::get('system', 'explicit_content', false), DI::l10n()->t('Set this to announce that your node is used mostly for explicit content that might not be suited for minors. This information will be published in the node information and might be used, e.g. by the global directory, to filter your node from listings of nodes to join. Additionally a note about this will be shown at the user registration page.')], '$explicit_content' => ['explicit_content', DI::l10n()->t('Explicit Content'), DI::config()->get('system', 'explicit_content', false), DI::l10n()->t('Set this to announce that your node is used mostly for explicit content that might not be suited for minors. This information will be published in the node information and might be used, e.g. by the global directory, to filter your node from listings of nodes to join. Additionally a note about this will be shown at the user registration page.')],
'$allow_users_remote_self'=> ['allow_users_remote_self', DI::l10n()->t('Allow Users to set remote_self'), Config::get('system', 'allow_users_remote_self'), DI::l10n()->t('With checking this, every user is allowed to mark every contact as a remote_self in the repair contact dialog. Setting this flag on a contact causes mirroring every posting of that contact in the users stream.')], '$allow_users_remote_self'=> ['allow_users_remote_self', DI::l10n()->t('Allow Users to set remote_self'), DI::config()->get('system', 'allow_users_remote_self'), DI::l10n()->t('With checking this, every user is allowed to mark every contact as a remote_self in the repair contact dialog. Setting this flag on a contact causes mirroring every posting of that contact in the users stream.')],
'$no_multi_reg' => ['no_multi_reg', DI::l10n()->t('Block multiple registrations'), Config::get('system', 'block_extended_register'), DI::l10n()->t('Disallow users to register additional accounts for use as pages.')], '$no_multi_reg' => ['no_multi_reg', DI::l10n()->t('Block multiple registrations'), DI::config()->get('system', 'block_extended_register'), DI::l10n()->t('Disallow users to register additional accounts for use as pages.')],
'$no_openid' => ['no_openid', DI::l10n()->t('Disable OpenID'), Config::get('system', 'no_openid'), DI::l10n()->t('Disable OpenID support for registration and logins.')], '$no_openid' => ['no_openid', DI::l10n()->t('Disable OpenID'), DI::config()->get('system', 'no_openid'), DI::l10n()->t('Disable OpenID support for registration and logins.')],
'$no_regfullname' => ['no_regfullname', DI::l10n()->t('No Fullname check'), Config::get('system', 'no_regfullname'), DI::l10n()->t('Allow users to register without a space between the first name and the last name in their full name.')], '$no_regfullname' => ['no_regfullname', DI::l10n()->t('No Fullname check'), DI::config()->get('system', 'no_regfullname'), DI::l10n()->t('Allow users to register without a space between the first name and the last name in their full name.')],
'$community_page_style' => ['community_page_style', DI::l10n()->t('Community pages for visitors'), Config::get('system', 'community_page_style'), DI::l10n()->t('Which community pages should be available for visitors. Local users always see both pages.'), $community_page_style_choices], '$community_page_style' => ['community_page_style', DI::l10n()->t('Community pages for visitors'), DI::config()->get('system', 'community_page_style'), DI::l10n()->t('Which community pages should be available for visitors. Local users always see both pages.'), $community_page_style_choices],
'$max_author_posts_community_page' => ['max_author_posts_community_page', DI::l10n()->t('Posts per user on community page'), Config::get('system', 'max_author_posts_community_page'), DI::l10n()->t('The maximum number of posts per user on the community page. (Not valid for "Global Community")')], '$max_author_posts_community_page' => ['max_author_posts_community_page', DI::l10n()->t('Posts per user on community page'), DI::config()->get('system', 'max_author_posts_community_page'), DI::l10n()->t('The maximum number of posts per user on the community page. (Not valid for "Global Community")')],
'$ostatus_disabled' => ['ostatus_disabled', DI::l10n()->t('Disable OStatus support'), Config::get('system', 'ostatus_disabled'), DI::l10n()->t('Disable built-in OStatus (StatusNet, GNU Social etc.) compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.')], '$ostatus_disabled' => ['ostatus_disabled', DI::l10n()->t('Disable OStatus support'), DI::config()->get('system', 'ostatus_disabled'), DI::l10n()->t('Disable built-in OStatus (StatusNet, GNU Social etc.) compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.')],
'$ostatus_not_able' => DI::l10n()->t('OStatus support can only be enabled if threading is enabled.'), '$ostatus_not_able' => DI::l10n()->t('OStatus support can only be enabled if threading is enabled.'),
'$diaspora_able' => $diaspora_able, '$diaspora_able' => $diaspora_able,
'$diaspora_not_able' => DI::l10n()->t('Diaspora support can\'t be enabled because Friendica was installed into a sub directory.'), '$diaspora_not_able' => DI::l10n()->t('Diaspora support can\'t be enabled because Friendica was installed into a sub directory.'),
'$diaspora_enabled' => ['diaspora_enabled', DI::l10n()->t('Enable Diaspora support'), Config::get('system', 'diaspora_enabled', $diaspora_able), DI::l10n()->t('Provide built-in Diaspora network compatibility.')], '$diaspora_enabled' => ['diaspora_enabled', DI::l10n()->t('Enable Diaspora support'), DI::config()->get('system', 'diaspora_enabled', $diaspora_able), DI::l10n()->t('Provide built-in Diaspora network compatibility.')],
'$dfrn_only' => ['dfrn_only', DI::l10n()->t('Only allow Friendica contacts'), Config::get('system', 'dfrn_only'), DI::l10n()->t('All contacts must use Friendica protocols. All other built-in communication protocols disabled.')], '$dfrn_only' => ['dfrn_only', DI::l10n()->t('Only allow Friendica contacts'), DI::config()->get('system', 'dfrn_only'), DI::l10n()->t('All contacts must use Friendica protocols. All other built-in communication protocols disabled.')],
'$verifyssl' => ['verifyssl', DI::l10n()->t('Verify SSL'), Config::get('system', 'verifyssl'), DI::l10n()->t('If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.')], '$verifyssl' => ['verifyssl', DI::l10n()->t('Verify SSL'), DI::config()->get('system', 'verifyssl'), DI::l10n()->t('If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.')],
'$proxyuser' => ['proxyuser', DI::l10n()->t('Proxy user'), Config::get('system', 'proxyuser'), ''], '$proxyuser' => ['proxyuser', DI::l10n()->t('Proxy user'), DI::config()->get('system', 'proxyuser'), ''],
'$proxy' => ['proxy', DI::l10n()->t('Proxy URL'), Config::get('system', 'proxy'), ''], '$proxy' => ['proxy', DI::l10n()->t('Proxy URL'), DI::config()->get('system', 'proxy'), ''],
'$timeout' => ['timeout', DI::l10n()->t('Network timeout'), Config::get('system', 'curl_timeout', 60), DI::l10n()->t('Value is in seconds. Set to 0 for unlimited (not recommended).')], '$timeout' => ['timeout', DI::l10n()->t('Network timeout'), DI::config()->get('system', 'curl_timeout', 60), DI::l10n()->t('Value is in seconds. Set to 0 for unlimited (not recommended).')],
'$maxloadavg' => ['maxloadavg', DI::l10n()->t('Maximum Load Average'), Config::get('system', 'maxloadavg', 20), DI::l10n()->t('Maximum system load before delivery and poll processes are deferred - default %d.', 20)], '$maxloadavg' => ['maxloadavg', DI::l10n()->t('Maximum Load Average'), DI::config()->get('system', 'maxloadavg', 20), DI::l10n()->t('Maximum system load before delivery and poll processes are deferred - default %d.', 20)],
'$maxloadavg_frontend' => ['maxloadavg_frontend', DI::l10n()->t('Maximum Load Average (Frontend)'), Config::get('system', 'maxloadavg_frontend', 50), DI::l10n()->t('Maximum system load before the frontend quits service - default 50.')], '$maxloadavg_frontend' => ['maxloadavg_frontend', DI::l10n()->t('Maximum Load Average (Frontend)'), DI::config()->get('system', 'maxloadavg_frontend', 50), DI::l10n()->t('Maximum system load before the frontend quits service - default 50.')],
'$min_memory' => ['min_memory', DI::l10n()->t('Minimal Memory'), Config::get('system', 'min_memory', 0), DI::l10n()->t('Minimal free memory in MB for the worker. Needs access to /proc/meminfo - default 0 (deactivated).')], '$min_memory' => ['min_memory', DI::l10n()->t('Minimal Memory'), DI::config()->get('system', 'min_memory', 0), DI::l10n()->t('Minimal free memory in MB for the worker. Needs access to /proc/meminfo - default 0 (deactivated).')],
'$optimize_max_tablesize' => ['optimize_max_tablesize', DI::l10n()->t('Maximum table size for optimization'), $optimize_max_tablesize, DI::l10n()->t('Maximum table size (in MB) for the automatic optimization. Enter -1 to disable it.')], '$optimize_max_tablesize' => ['optimize_max_tablesize', DI::l10n()->t('Maximum table size for optimization'), $optimize_max_tablesize, DI::l10n()->t('Maximum table size (in MB) for the automatic optimization. Enter -1 to disable it.')],
'$optimize_fragmentation' => ['optimize_fragmentation', DI::l10n()->t('Minimum level of fragmentation'), Config::get('system', 'optimize_fragmentation', 30), DI::l10n()->t('Minimum fragmenation level to start the automatic optimization - default value is 30%.')], '$optimize_fragmentation' => ['optimize_fragmentation', DI::l10n()->t('Minimum level of fragmentation'), DI::config()->get('system', 'optimize_fragmentation', 30), DI::l10n()->t('Minimum fragmenation level to start the automatic optimization - default value is 30%.')],
'$poco_completion' => ['poco_completion', DI::l10n()->t('Periodical check of global contacts'), Config::get('system', 'poco_completion'), DI::l10n()->t('If enabled, the global contacts are checked periodically for missing or outdated data and the vitality of the contacts and servers.')], '$poco_completion' => ['poco_completion', DI::l10n()->t('Periodical check of global contacts'), DI::config()->get('system', 'poco_completion'), DI::l10n()->t('If enabled, the global contacts are checked periodically for missing or outdated data and the vitality of the contacts and servers.')],
'$poco_requery_days' => ['poco_requery_days', DI::l10n()->t('Days between requery'), Config::get('system', 'poco_requery_days'), DI::l10n()->t('Number of days after which a server is requeried for his contacts.')], '$poco_requery_days' => ['poco_requery_days', DI::l10n()->t('Days between requery'), DI::config()->get('system', 'poco_requery_days'), DI::l10n()->t('Number of days after which a server is requeried for his contacts.')],
'$poco_discovery' => ['poco_discovery', DI::l10n()->t('Discover contacts from other servers'), (string)intval(Config::get('system', 'poco_discovery')), DI::l10n()->t('Periodically query other servers for contacts. You can choose between "Users": the users on the remote system, "Global Contacts": active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren\'t available. The fallback increases the server load, so the recommended setting is "Users, Global Contacts".'), $poco_discovery_choices], '$poco_discovery' => ['poco_discovery', DI::l10n()->t('Discover contacts from other servers'), (string)intval(DI::config()->get('system', 'poco_discovery')), DI::l10n()->t('Periodically query other servers for contacts. You can choose between "Users": the users on the remote system, "Global Contacts": active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren\'t available. The fallback increases the server load, so the recommended setting is "Users, Global Contacts".'), $poco_discovery_choices],
'$poco_discovery_since' => ['poco_discovery_since', DI::l10n()->t('Timeframe for fetching global contacts'), (string)intval(Config::get('system', 'poco_discovery_since')), DI::l10n()->t('When the discovery is activated, this value defines the timeframe for the activity of the global contacts that are fetched from other servers.'), $poco_discovery_since_choices], '$poco_discovery_since' => ['poco_discovery_since', DI::l10n()->t('Timeframe for fetching global contacts'), (string)intval(DI::config()->get('system', 'poco_discovery_since')), DI::l10n()->t('When the discovery is activated, this value defines the timeframe for the activity of the global contacts that are fetched from other servers.'), $poco_discovery_since_choices],
'$poco_local_search' => ['poco_local_search', DI::l10n()->t('Search the local directory'), Config::get('system', 'poco_local_search'), DI::l10n()->t('Search the local directory instead of the global directory. When searching locally, every search will be executed on the global directory in the background. This improves the search results when the search is repeated.')], '$poco_local_search' => ['poco_local_search', DI::l10n()->t('Search the local directory'), DI::config()->get('system', 'poco_local_search'), DI::l10n()->t('Search the local directory instead of the global directory. When searching locally, every search will be executed on the global directory in the background. This improves the search results when the search is repeated.')],
'$nodeinfo' => ['nodeinfo', DI::l10n()->t('Publish server information'), Config::get('system', 'nodeinfo'), DI::l10n()->t('If enabled, general server and usage data will be published. The data contains the name and version of the server, number of users with public profiles, number of posts and the activated protocols and connectors. See <a href="http://the-federation.info/">the-federation.info</a> for details.')], '$nodeinfo' => ['nodeinfo', DI::l10n()->t('Publish server information'), DI::config()->get('system', 'nodeinfo'), DI::l10n()->t('If enabled, general server and usage data will be published. The data contains the name and version of the server, number of users with public profiles, number of posts and the activated protocols and connectors. See <a href="http://the-federation.info/">the-federation.info</a> for details.')],
'$check_new_version_url' => ['check_new_version_url', DI::l10n()->t('Check upstream version'), Config::get('system', 'check_new_version_url'), DI::l10n()->t('Enables checking for new Friendica versions at github. If there is a new version, you will be informed in the admin panel overview.'), $check_git_version_choices], '$check_new_version_url' => ['check_new_version_url', DI::l10n()->t('Check upstream version'), DI::config()->get('system', 'check_new_version_url'), DI::l10n()->t('Enables checking for new Friendica versions at github. If there is a new version, you will be informed in the admin panel overview.'), $check_git_version_choices],
'$suppress_tags' => ['suppress_tags', DI::l10n()->t('Suppress Tags'), Config::get('system', 'suppress_tags'), DI::l10n()->t('Suppress showing a list of hashtags at the end of the posting.')], '$suppress_tags' => ['suppress_tags', DI::l10n()->t('Suppress Tags'), DI::config()->get('system', 'suppress_tags'), DI::l10n()->t('Suppress showing a list of hashtags at the end of the posting.')],
'$dbclean' => ['dbclean', DI::l10n()->t('Clean database'), Config::get('system', 'dbclean', false), DI::l10n()->t('Remove old remote items, orphaned database records and old content from some other helper tables.')], '$dbclean' => ['dbclean', DI::l10n()->t('Clean database'), DI::config()->get('system', 'dbclean', false), DI::l10n()->t('Remove old remote items, orphaned database records and old content from some other helper tables.')],
'$dbclean_expire_days' => ['dbclean_expire_days', DI::l10n()->t('Lifespan of remote items'), Config::get('system', 'dbclean-expire-days', 0), DI::l10n()->t('When the database cleanup is enabled, this defines the days after which remote items will be deleted. Own items, and marked or filed items are always kept. 0 disables this behaviour.')], '$dbclean_expire_days' => ['dbclean_expire_days', DI::l10n()->t('Lifespan of remote items'), DI::config()->get('system', 'dbclean-expire-days', 0), DI::l10n()->t('When the database cleanup is enabled, this defines the days after which remote items will be deleted. Own items, and marked or filed items are always kept. 0 disables this behaviour.')],
'$dbclean_unclaimed' => ['dbclean_unclaimed', DI::l10n()->t('Lifespan of unclaimed items'), Config::get('system', 'dbclean-expire-unclaimed', 90), DI::l10n()->t('When the database cleanup is enabled, this defines the days after which unclaimed remote items (mostly content from the relay) will be deleted. Default value is 90 days. Defaults to the general lifespan value of remote items if set to 0.')], '$dbclean_unclaimed' => ['dbclean_unclaimed', DI::l10n()->t('Lifespan of unclaimed items'), DI::config()->get('system', 'dbclean-expire-unclaimed', 90), DI::l10n()->t('When the database cleanup is enabled, this defines the days after which unclaimed remote items (mostly content from the relay) will be deleted. Default value is 90 days. Defaults to the general lifespan value of remote items if set to 0.')],
'$dbclean_expire_conv' => ['dbclean_expire_conv', DI::l10n()->t('Lifespan of raw conversation data'), Config::get('system', 'dbclean_expire_conversation', 90), DI::l10n()->t('The conversation data is used for ActivityPub and OStatus, as well as for debug purposes. It should be safe to remove it after 14 days, default is 90 days.')], '$dbclean_expire_conv' => ['dbclean_expire_conv', DI::l10n()->t('Lifespan of raw conversation data'), DI::config()->get('system', 'dbclean_expire_conversation', 90), DI::l10n()->t('The conversation data is used for ActivityPub and OStatus, as well as for debug purposes. It should be safe to remove it after 14 days, default is 90 days.')],
'$itemcache' => ['itemcache', DI::l10n()->t('Path to item cache'), Config::get('system', 'itemcache'), DI::l10n()->t('The item caches buffers generated bbcode and external images.')], '$itemcache' => ['itemcache', DI::l10n()->t('Path to item cache'), DI::config()->get('system', 'itemcache'), DI::l10n()->t('The item caches buffers generated bbcode and external images.')],
'$itemcache_duration' => ['itemcache_duration', DI::l10n()->t('Cache duration in seconds'), Config::get('system', 'itemcache_duration'), DI::l10n()->t('How long should the cache files be hold? Default value is 86400 seconds (One day). To disable the item cache, set the value to -1.')], '$itemcache_duration' => ['itemcache_duration', DI::l10n()->t('Cache duration in seconds'), DI::config()->get('system', 'itemcache_duration'), DI::l10n()->t('How long should the cache files be hold? Default value is 86400 seconds (One day). To disable the item cache, set the value to -1.')],
'$max_comments' => ['max_comments', DI::l10n()->t('Maximum numbers of comments per post'), Config::get('system', 'max_comments'), DI::l10n()->t('How much comments should be shown for each post? Default value is 100.')], '$max_comments' => ['max_comments', DI::l10n()->t('Maximum numbers of comments per post'), DI::config()->get('system', 'max_comments'), DI::l10n()->t('How much comments should be shown for each post? Default value is 100.')],
'$temppath' => ['temppath', DI::l10n()->t('Temp path'), Config::get('system', 'temppath'), DI::l10n()->t('If you have a restricted system where the webserver can\'t access the system temp path, enter another path here.')], '$temppath' => ['temppath', DI::l10n()->t('Temp path'), DI::config()->get('system', 'temppath'), DI::l10n()->t('If you have a restricted system where the webserver can\'t access the system temp path, enter another path here.')],
'$proxy_disabled' => ['proxy_disabled', DI::l10n()->t('Disable picture proxy'), Config::get('system', 'proxy_disabled'), DI::l10n()->t('The picture proxy increases performance and privacy. It shouldn\'t be used on systems with very low bandwidth.')], '$proxy_disabled' => ['proxy_disabled', DI::l10n()->t('Disable picture proxy'), DI::config()->get('system', 'proxy_disabled'), DI::l10n()->t('The picture proxy increases performance and privacy. It shouldn\'t be used on systems with very low bandwidth.')],
'$only_tag_search' => ['only_tag_search', DI::l10n()->t('Only search in tags'), Config::get('system', 'only_tag_search'), DI::l10n()->t('On large systems the text search can slow down the system extremely.')], '$only_tag_search' => ['only_tag_search', DI::l10n()->t('Only search in tags'), DI::config()->get('system', 'only_tag_search'), DI::l10n()->t('On large systems the text search can slow down the system extremely.')],
'$relocate_url' => ['relocate_url', DI::l10n()->t('New base url'), DI::baseUrl()->get(), DI::l10n()->t('Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.')], '$relocate_url' => ['relocate_url', DI::l10n()->t('New base url'), DI::baseUrl()->get(), DI::l10n()->t('Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.')],
'$rino' => ['rino', DI::l10n()->t('RINO Encryption'), intval(Config::get('system', 'rino_encrypt')), DI::l10n()->t('Encryption layer between nodes.'), [0 => DI::l10n()->t('Disabled'), 1 => DI::l10n()->t('Enabled')]], '$rino' => ['rino', DI::l10n()->t('RINO Encryption'), intval(DI::config()->get('system', 'rino_encrypt')), DI::l10n()->t('Encryption layer between nodes.'), [0 => DI::l10n()->t('Disabled'), 1 => DI::l10n()->t('Enabled')]],
'$worker_queues' => ['worker_queues', DI::l10n()->t('Maximum number of parallel workers'), Config::get('system', 'worker_queues'), DI::l10n()->t('On shared hosters set this to %d. On larger systems, values of %d are great. Default value is %d.', 5, 20, 10)], '$worker_queues' => ['worker_queues', DI::l10n()->t('Maximum number of parallel workers'), DI::config()->get('system', 'worker_queues'), DI::l10n()->t('On shared hosters set this to %d. On larger systems, values of %d are great. Default value is %d.', 5, 20, 10)],
'$worker_dont_fork' => ['worker_dont_fork', DI::l10n()->t('Don\'t use "proc_open" with the worker'), Config::get('system', 'worker_dont_fork'), DI::l10n()->t('Enable this if your system doesn\'t allow the use of "proc_open". This can happen on shared hosters. If this is enabled you should increase the frequency of worker calls in your crontab.')], '$worker_dont_fork' => ['worker_dont_fork', DI::l10n()->t('Don\'t use "proc_open" with the worker'), DI::config()->get('system', 'worker_dont_fork'), DI::l10n()->t('Enable this if your system doesn\'t allow the use of "proc_open". This can happen on shared hosters. If this is enabled you should increase the frequency of worker calls in your crontab.')],
'$worker_fastlane' => ['worker_fastlane', DI::l10n()->t('Enable fastlane'), Config::get('system', 'worker_fastlane'), DI::l10n()->t('When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.')], '$worker_fastlane' => ['worker_fastlane', DI::l10n()->t('Enable fastlane'), DI::config()->get('system', 'worker_fastlane'), DI::l10n()->t('When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.')],
'$worker_frontend' => ['worker_frontend', DI::l10n()->t('Enable frontend worker'), Config::get('system', 'frontend_worker'), DI::l10n()->t('When enabled the Worker process is triggered when backend access is performed (e.g. messages being delivered). On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.', DI::baseUrl()->get())], '$worker_frontend' => ['worker_frontend', DI::l10n()->t('Enable frontend worker'), DI::config()->get('system', 'frontend_worker'), DI::l10n()->t('When enabled the Worker process is triggered when backend access is performed (e.g. messages being delivered). On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.', DI::baseUrl()->get())],
'$relay_subscribe' => ['relay_subscribe', DI::l10n()->t('Subscribe to relay'), Config::get('system', 'relay_subscribe'), DI::l10n()->t('Enables the receiving of public posts from the relay. They will be included in the search, subscribed tags and on the global community page.')], '$relay_subscribe' => ['relay_subscribe', DI::l10n()->t('Subscribe to relay'), DI::config()->get('system', 'relay_subscribe'), DI::l10n()->t('Enables the receiving of public posts from the relay. They will be included in the search, subscribed tags and on the global community page.')],
'$relay_server' => ['relay_server', DI::l10n()->t('Relay server'), Config::get('system', 'relay_server', 'https://relay.diasp.org'), DI::l10n()->t('Address of the relay server where public posts should be send to. For example https://relay.diasp.org')], '$relay_server' => ['relay_server', DI::l10n()->t('Relay server'), DI::config()->get('system', 'relay_server', 'https://relay.diasp.org'), DI::l10n()->t('Address of the relay server where public posts should be send to. For example https://relay.diasp.org')],
'$relay_directly' => ['relay_directly', DI::l10n()->t('Direct relay transfer'), Config::get('system', 'relay_directly'), DI::l10n()->t('Enables the direct transfer to other servers without using the relay servers')], '$relay_directly' => ['relay_directly', DI::l10n()->t('Direct relay transfer'), DI::config()->get('system', 'relay_directly'), DI::l10n()->t('Enables the direct transfer to other servers without using the relay servers')],
'$relay_scope' => ['relay_scope', DI::l10n()->t('Relay scope'), Config::get('system', 'relay_scope'), DI::l10n()->t('Can be "all" or "tags". "all" means that every public post should be received. "tags" means that only posts with selected tags should be received.'), ['' => DI::l10n()->t('Disabled'), 'all' => DI::l10n()->t('all'), 'tags' => DI::l10n()->t('tags')]], '$relay_scope' => ['relay_scope', DI::l10n()->t('Relay scope'), DI::config()->get('system', 'relay_scope'), DI::l10n()->t('Can be "all" or "tags". "all" means that every public post should be received. "tags" means that only posts with selected tags should be received.'), ['' => DI::l10n()->t('Disabled'), 'all' => DI::l10n()->t('all'), 'tags' => DI::l10n()->t('tags')]],
'$relay_server_tags' => ['relay_server_tags', DI::l10n()->t('Server tags'), Config::get('system', 'relay_server_tags'), DI::l10n()->t('Comma separated list of tags for the "tags" subscription.')], '$relay_server_tags' => ['relay_server_tags', DI::l10n()->t('Server tags'), DI::config()->get('system', 'relay_server_tags'), DI::l10n()->t('Comma separated list of tags for the "tags" subscription.')],
'$relay_user_tags' => ['relay_user_tags', DI::l10n()->t('Allow user tags'), Config::get('system', 'relay_user_tags', true), DI::l10n()->t('If enabled, the tags from the saved searches will used for the "tags" subscription in addition to the "relay_server_tags".')], '$relay_user_tags' => ['relay_user_tags', DI::l10n()->t('Allow user tags'), DI::config()->get('system', 'relay_user_tags', true), DI::l10n()->t('If enabled, the tags from the saved searches will used for the "tags" subscription in addition to the "relay_server_tags".')],
'$form_security_token' => parent::getFormSecurityToken('admin_site'), '$form_security_token' => parent::getFormSecurityToken('admin_site'),
'$relocate_button' => DI::l10n()->t('Start Relocation'), '$relocate_button' => DI::l10n()->t('Start Relocation'),

View file

@ -33,26 +33,26 @@ class Summary extends BaseAdminModule
// Check if github.com/friendica/master/VERSION is higher then // Check if github.com/friendica/master/VERSION is higher then
// the local version of Friendica. Check is opt-in, source may be master or devel branch // the local version of Friendica. Check is opt-in, source may be master or devel branch
if (Config::get('system', 'check_new_version_url', 'none') != 'none') { if (DI::config()->get('system', 'check_new_version_url', 'none') != 'none') {
$gitversion = Config::get('system', 'git_friendica_version'); $gitversion = DI::config()->get('system', 'git_friendica_version');
if (version_compare(FRIENDICA_VERSION, $gitversion) < 0) { if (version_compare(FRIENDICA_VERSION, $gitversion) < 0) {
$warningtext[] = DI::l10n()->t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s', FRIENDICA_VERSION, $gitversion); $warningtext[] = DI::l10n()->t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s', FRIENDICA_VERSION, $gitversion);
} }
} }
if (Config::get('system', 'dbupdate', DBStructure::UPDATE_NOT_CHECKED) == DBStructure::UPDATE_NOT_CHECKED) { if (DI::config()->get('system', 'dbupdate', DBStructure::UPDATE_NOT_CHECKED) == DBStructure::UPDATE_NOT_CHECKED) {
DBStructure::update($a->getBasePath(), false, true); DBStructure::update($a->getBasePath(), false, true);
} }
if (Config::get('system', 'dbupdate') == DBStructure::UPDATE_FAILED) { if (DI::config()->get('system', 'dbupdate') == DBStructure::UPDATE_FAILED) {
$warningtext[] = DI::l10n()->t('The database update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear.'); $warningtext[] = DI::l10n()->t('The database update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear.');
} }
if (Config::get('system', 'update') == Update::FAILED) { if (DI::config()->get('system', 'update') == Update::FAILED) {
$warningtext[] = DI::l10n()->t('The last update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear. (Some of the errors are possibly inside the logfile.)'); $warningtext[] = DI::l10n()->t('The last update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear. (Some of the errors are possibly inside the logfile.)');
} }
$last_worker_call = Config::get('system', 'last_worker_execution', false); $last_worker_call = DI::config()->get('system', 'last_worker_execution', false);
if (!$last_worker_call) { if (!$last_worker_call) {
$warningtext[] = DI::l10n()->t('The worker was never executed. Please check your database structure!'); $warningtext[] = DI::l10n()->t('The worker was never executed. Please check your database structure!');
} elseif ((strtotime(DateTimeFormat::utcNow()) - strtotime($last_worker_call)) > 60 * 60) { } elseif ((strtotime(DateTimeFormat::utcNow()) - strtotime($last_worker_call)) > 60 * 60) {
@ -76,8 +76,8 @@ class Summary extends BaseAdminModule
} }
// Check logfile permission // Check logfile permission
if (Config::get('system', 'debugging')) { if (DI::config()->get('system', 'debugging')) {
$file = Config::get('system', 'logfile'); $file = DI::config()->get('system', 'logfile');
$fileSystem = DI::fs(); $fileSystem = DI::fs();
@ -92,7 +92,7 @@ class Summary extends BaseAdminModule
$warningtext[] = DI::l10n()->t('The logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage()); $warningtext[] = DI::l10n()->t('The logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage());
} }
$file = Config::get('system', 'dlogfile'); $file = DI::config()->get('system', 'dlogfile');
try { try {
if (!empty($file)) { if (!empty($file)) {
@ -196,7 +196,7 @@ class Summary extends BaseAdminModule
'$version' => [DI::l10n()->t('Version'), FRIENDICA_VERSION], '$version' => [DI::l10n()->t('Version'), FRIENDICA_VERSION],
'$platform' => FRIENDICA_PLATFORM, '$platform' => FRIENDICA_PLATFORM,
'$codename' => FRIENDICA_CODENAME, '$codename' => FRIENDICA_CODENAME,
'$build' => Config::get('system', 'build'), '$build' => DI::config()->get('system', 'build'),
'$addons' => [DI::l10n()->t('Active addons'), Addon::getEnabledList()], '$addons' => [DI::l10n()->t('Active addons'), Addon::getEnabledList()],
'$serversettings' => $server_settings, '$serversettings' => $server_settings,
'$warningtext' => $warningtext '$warningtext' => $warningtext

View file

@ -77,7 +77,7 @@ class Index extends BaseAdminModule
$is_supported = 1 - (intval(file_exists($file . '/unsupported'))); $is_supported = 1 - (intval(file_exists($file . '/unsupported')));
$is_allowed = intval(in_array($theme, $allowed_themes)); $is_allowed = intval(in_array($theme, $allowed_themes));
if ($is_allowed || $is_supported || Config::get('system', 'show_unsupported_themes')) { if ($is_allowed || $is_supported || DI::config()->get('system', 'show_unsupported_themes')) {
$themes[] = ['name' => $theme, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed]; $themes[] = ['name' => $theme, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed];
} }
} }

View file

@ -41,11 +41,11 @@ class Tos extends BaseAdminModule
return Renderer::replaceMacros($t, [ return Renderer::replaceMacros($t, [
'$title' => DI::l10n()->t('Administration'), '$title' => DI::l10n()->t('Administration'),
'$page' => DI::l10n()->t('Terms of Service'), '$page' => DI::l10n()->t('Terms of Service'),
'$displaytos' => ['displaytos', DI::l10n()->t('Display Terms of Service'), Config::get('system', 'tosdisplay'), DI::l10n()->t('Enable the Terms of Service page. If this is enabled a link to the terms will be added to the registration form and the general information page.')], '$displaytos' => ['displaytos', DI::l10n()->t('Display Terms of Service'), DI::config()->get('system', 'tosdisplay'), DI::l10n()->t('Enable the Terms of Service page. If this is enabled a link to the terms will be added to the registration form and the general information page.')],
'$displayprivstatement' => ['displayprivstatement', DI::l10n()->t('Display Privacy Statement'), Config::get('system', 'tosprivstatement'), DI::l10n()->t('Show some informations regarding the needed information to operate the node according e.g. to <a href="%s" target="_blank">EU-GDPR</a>.', 'https://en.wikipedia.org/wiki/General_Data_Protection_Regulation')], '$displayprivstatement' => ['displayprivstatement', DI::l10n()->t('Display Privacy Statement'), DI::config()->get('system', 'tosprivstatement'), DI::l10n()->t('Show some informations regarding the needed information to operate the node according e.g. to <a href="%s" target="_blank">EU-GDPR</a>.', 'https://en.wikipedia.org/wiki/General_Data_Protection_Regulation')],
'$preview' => DI::l10n()->t('Privacy Statement Preview'), '$preview' => DI::l10n()->t('Privacy Statement Preview'),
'$privtext' => $tos->privacy_complete, '$privtext' => $tos->privacy_complete,
'$tostext' => ['tostext', DI::l10n()->t('The Terms of Service'), Config::get('system', 'tostext'), DI::l10n()->t('Enter the Terms of Service for your node here. You can use BBCode. Headers of sections should be [h2] and below.')], '$tostext' => ['tostext', DI::l10n()->t('The Terms of Service'), DI::config()->get('system', 'tostext'), DI::l10n()->t('Enter the Terms of Service for your node here. You can use BBCode. Headers of sections should be [h2] and below.')],
'$form_security_token' => parent::getFormSecurityToken('admin_tos'), '$form_security_token' => parent::getFormSecurityToken('admin_tos'),
'$submit' => DI::l10n()->t('Save Settings'), '$submit' => DI::l10n()->t('Save Settings'),
]); ]);

View file

@ -24,7 +24,7 @@ class Users extends BaseAdminModule
$nu_name = $_POST['new_user_name'] ?? ''; $nu_name = $_POST['new_user_name'] ?? '';
$nu_nickname = $_POST['new_user_nickname'] ?? ''; $nu_nickname = $_POST['new_user_nickname'] ?? '';
$nu_email = $_POST['new_user_email'] ?? ''; $nu_email = $_POST['new_user_email'] ?? '';
$nu_language = Config::get('system', 'language'); $nu_language = DI::config()->get('system', 'language');
parent::checkFormSecurityTokenRedirectOnError('/admin/users', 'admin_users'); parent::checkFormSecurityTokenRedirectOnError('/admin/users', 'admin_users');
@ -74,8 +74,8 @@ class Users extends BaseAdminModule
Thank you and welcome to %4$s.')); Thank you and welcome to %4$s.'));
$preamble = sprintf($preamble, $user['username'], Config::get('config', 'sitename')); $preamble = sprintf($preamble, $user['username'], DI::config()->get('config', 'sitename'));
$body = sprintf($body, DI::baseUrl()->get(), $user['nickname'], $result['password'], Config::get('config', 'sitename')); $body = sprintf($body, DI::baseUrl()->get(), $user['nickname'], $result['password'], DI::config()->get('config', 'sitename'));
notification([ notification([
'type' => SYSTEM_EMAIL, 'type' => SYSTEM_EMAIL,
@ -83,7 +83,7 @@ class Users extends BaseAdminModule
'to_name' => $user['username'], 'to_name' => $user['username'],
'to_email' => $user['email'], 'to_email' => $user['email'],
'uid' => $user['uid'], 'uid' => $user['uid'],
'subject' => DI::l10n()->t('Registration details for %s', Config::get('config', 'sitename')), 'subject' => DI::l10n()->t('Registration details for %s', DI::config()->get('config', 'sitename')),
'preamble' => $preamble, 'preamble' => $preamble,
'body' => $body]); 'body' => $body]);
} }
@ -214,7 +214,7 @@ class Users extends BaseAdminModule
); );
$users = DBA::toArray($usersStmt); $users = DBA::toArray($usersStmt);
$adminlist = explode(',', str_replace(' ', '', Config::get('config', 'admin_email'))); $adminlist = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email')));
$_setup_users = function ($e) use ($adminlist) { $_setup_users = function ($e) use ($adminlist) {
$page_types = [ $page_types = [
User::PAGE_FLAGS_NORMAL => DI::l10n()->t('Normal Account Page'), User::PAGE_FLAGS_NORMAL => DI::l10n()->t('Normal Account Page'),

View file

@ -15,7 +15,7 @@ class Apps extends BaseModule
{ {
public static function init(array $parameters = []) public static function init(array $parameters = [])
{ {
$privateaddons = Config::get('config', 'private_addons'); $privateaddons = DI::config()->get('config', 'private_addons');
if ($privateaddons === "1" && !local_user()) { if ($privateaddons === "1" && !local_user()) {
DI::baseUrl()->redirect(); DI::baseUrl()->redirect();
} }

View file

@ -23,7 +23,7 @@ class Hovercard extends BaseModule
$contact_url = $_REQUEST['url'] ?? ''; $contact_url = $_REQUEST['url'] ?? '';
// Get out if the system doesn't have public access allowed // Get out if the system doesn't have public access allowed
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
throw new HTTPException\ForbiddenException(); throw new HTTPException\ForbiddenException();
} }

View file

@ -146,7 +146,7 @@ class Group extends BaseModule
// Switch to text mode interface if we have more than 'n' contacts or group members // Switch to text mode interface if we have more than 'n' contacts or group members
$switchtotext = DI::pConfig()->get(local_user(), 'system', 'groupedit_image_limit'); $switchtotext = DI::pConfig()->get(local_user(), 'system', 'groupedit_image_limit');
if (is_null($switchtotext)) { if (is_null($switchtotext)) {
$switchtotext = Config::get('system', 'groupedit_image_limit', 200); $switchtotext = DI::config()->get('system', 'groupedit_image_limit', 200);
} }
$tpl = Renderer::getMarkupTemplate('group_edit.tpl'); $tpl = Renderer::getMarkupTemplate('group_edit.tpl');

View file

@ -30,7 +30,7 @@ class Inbox extends BaseModule
throw new \Friendica\Network\HTTPException\BadRequestException(); throw new \Friendica\Network\HTTPException\BadRequestException();
} }
if (Config::get('debug', 'ap_inbox_log')) { if (DI::config()->get('debug', 'ap_inbox_log')) {
if (HTTPSignature::getSigner($postdata, $_SERVER)) { if (HTTPSignature::getSigner($postdata, $_SERVER)) {
$filename = 'signed-activitypub'; $filename = 'signed-activitypub';
} else { } else {

View file

@ -83,7 +83,7 @@ class Profile extends BaseModule
$page['htmlhead'] .= "\n"; $page['htmlhead'] .= "\n";
$blocked = !local_user() && !Session::getRemoteContactID($a->profile['profile_uid']) && Config::get('system', 'block_public'); $blocked = !local_user() && !Session::getRemoteContactID($a->profile['profile_uid']) && DI::config()->get('system', 'block_public');
$userblock = !local_user() && !Session::getRemoteContactID($a->profile['profile_uid']) && $a->profile['hidewall']; $userblock = !local_user() && !Session::getRemoteContactID($a->profile['profile_uid']) && $a->profile['hidewall'];
if (!empty($a->profile['page-flags']) && $a->profile['page-flags'] == User::PAGE_FLAGS_COMMUNITY) { if (!empty($a->profile['page-flags']) && $a->profile['page-flags'] == User::PAGE_FLAGS_COMMUNITY) {
@ -150,7 +150,7 @@ class Profile extends BaseModule
$hashtags = $_GET['tag'] ?? ''; $hashtags = $_GET['tag'] ?? '';
if (Config::get('system', 'block_public') && !local_user() && !Session::getRemoteContactID($a->profile['profile_uid'])) { if (DI::config()->get('system', 'block_public') && !local_user() && !Session::getRemoteContactID($a->profile['profile_uid'])) {
return Login::form(); return Login::form();
} }
@ -331,7 +331,7 @@ class Profile extends BaseModule
$last_updated_array[$last_updated_key] = time(); $last_updated_array[$last_updated_key] = time();
Session::set('last_updated', $last_updated_array); Session::set('last_updated', $last_updated_array);
if ($is_owner && !$update && !Config::get('theme', 'hide_eventlist')) { if ($is_owner && !$update && !DI::config()->get('theme', 'hide_eventlist')) {
$o .= ProfileModel::getBirthdays(); $o .= ProfileModel::getBirthdays();
$o .= ProfileModel::getEventsReminderHTML(); $o .= ProfileModel::getEventsReminderHTML();
} }

View file

@ -20,7 +20,7 @@ class Contacts extends BaseModule
{ {
public static function content(array $parameters = []) public static function content(array $parameters = [])
{ {
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('User not found.')); throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
} }

View file

@ -38,7 +38,7 @@ class Register extends BaseModule
// logged in users can register others (people/pages/groups) // logged in users can register others (people/pages/groups)
// even with closed registrations, unless specifically prohibited by site policy. // even with closed registrations, unless specifically prohibited by site policy.
// 'block_extended_register' blocks all registrations, period. // 'block_extended_register' blocks all registrations, period.
$block = Config::get('system', 'block_extended_register'); $block = DI::config()->get('system', 'block_extended_register');
if (local_user() && $block) { if (local_user() && $block) {
notice(DI::l10n()->t('Permission denied.')); notice(DI::l10n()->t('Permission denied.'));
@ -53,12 +53,12 @@ class Register extends BaseModule
} }
} }
if (!local_user() && (intval(Config::get('config', 'register_policy')) === self::CLOSED)) { if (!local_user() && (intval(DI::config()->get('config', 'register_policy')) === self::CLOSED)) {
notice(DI::l10n()->t('Permission denied.')); notice(DI::l10n()->t('Permission denied.'));
return ''; return '';
} }
$max_dailies = intval(Config::get('system', 'max_daily_registrations')); $max_dailies = intval(DI::config()->get('system', 'max_daily_registrations'));
if ($max_dailies) { if ($max_dailies) {
$count = DBA::count('user', ['`register_date` > UTC_TIMESTAMP - INTERVAL 1 day']); $count = DBA::count('user', ['`register_date` > UTC_TIMESTAMP - INTERVAL 1 day']);
if ($count >= $max_dailies) { if ($count >= $max_dailies) {
@ -75,7 +75,7 @@ class Register extends BaseModule
$photo = $_REQUEST['photo'] ?? ''; $photo = $_REQUEST['photo'] ?? '';
$invite_id = $_REQUEST['invite_id'] ?? ''; $invite_id = $_REQUEST['invite_id'] ?? '';
if (local_user() || Config::get('system', 'no_openid')) { if (local_user() || DI::config()->get('system', 'no_openid')) {
$fillwith = ''; $fillwith = '';
$fillext = ''; $fillext = '';
$oidlabel = ''; $oidlabel = '';
@ -85,7 +85,7 @@ class Register extends BaseModule
$oidlabel = DI::l10n()->t('Your OpenID (optional): '); $oidlabel = DI::l10n()->t('Your OpenID (optional): ');
} }
if (Config::get('system', 'publish_all')) { if (DI::config()->get('system', 'publish_all')) {
$profile_publish = '<input type="hidden" name="profile_publish_reg" value="1" />'; $profile_publish = '<input type="hidden" name="profile_publish_reg" value="1" />';
} else { } else {
$publish_tpl = Renderer::getMarkupTemplate('profile_publish.tpl'); $publish_tpl = Renderer::getMarkupTemplate('profile_publish.tpl');
@ -112,14 +112,14 @@ class Register extends BaseModule
$tos = new Tos(); $tos = new Tos();
$o = Renderer::replaceMacros($tpl, [ $o = Renderer::replaceMacros($tpl, [
'$invitations' => Config::get('system', 'invitation_only'), '$invitations' => DI::config()->get('system', 'invitation_only'),
'$permonly' => intval(Config::get('config', 'register_policy')) === self::APPROVE, '$permonly' => intval(DI::config()->get('config', 'register_policy')) === self::APPROVE,
'$permonlybox' => ['permonlybox', DI::l10n()->t('Note for the admin'), '', DI::l10n()->t('Leave a message for the admin, why you want to join this node'), 'required'], '$permonlybox' => ['permonlybox', DI::l10n()->t('Note for the admin'), '', DI::l10n()->t('Leave a message for the admin, why you want to join this node'), 'required'],
'$invite_desc' => DI::l10n()->t('Membership on this site is by invitation only.'), '$invite_desc' => DI::l10n()->t('Membership on this site is by invitation only.'),
'$invite_label' => DI::l10n()->t('Your invitation code: '), '$invite_label' => DI::l10n()->t('Your invitation code: '),
'$invite_id' => $invite_id, '$invite_id' => $invite_id,
'$regtitle' => DI::l10n()->t('Registration'), '$regtitle' => DI::l10n()->t('Registration'),
'$registertext' => BBCode::convert(Config::get('config', 'register_text', '')), '$registertext' => BBCode::convert(DI::config()->get('config', 'register_text', '')),
'$fillwith' => $fillwith, '$fillwith' => $fillwith,
'$fillext' => $fillext, '$fillext' => $fillext,
'$oidlabel' => $oidlabel, '$oidlabel' => $oidlabel,
@ -141,12 +141,12 @@ class Register extends BaseModule
'$sitename' => DI::baseUrl()->getHostname(), '$sitename' => DI::baseUrl()->getHostname(),
'$importh' => DI::l10n()->t('Import'), '$importh' => DI::l10n()->t('Import'),
'$importt' => DI::l10n()->t('Import your profile to this friendica instance'), '$importt' => DI::l10n()->t('Import your profile to this friendica instance'),
'$showtoslink' => Config::get('system', 'tosdisplay'), '$showtoslink' => DI::config()->get('system', 'tosdisplay'),
'$tostext' => DI::l10n()->t('Terms of Service'), '$tostext' => DI::l10n()->t('Terms of Service'),
'$showprivstatement' => Config::get('system', 'tosprivstatement'), '$showprivstatement' => DI::config()->get('system', 'tosprivstatement'),
'$privstatement'=> $tos->privacy_complete, '$privstatement'=> $tos->privacy_complete,
'$form_security_token' => BaseModule::getFormSecurityToken('register'), '$form_security_token' => BaseModule::getFormSecurityToken('register'),
'$explicit_content' => Config::get('system', 'explicit_content', false), '$explicit_content' => DI::config()->get('system', 'explicit_content', false),
'$explicit_content_note' => DI::l10n()->t('Note: This node explicitly contains adult content'), '$explicit_content_note' => DI::l10n()->t('Note: This node explicitly contains adult content'),
'$additional' => !empty(local_user()), '$additional' => !empty(local_user()),
'$parent_password' => ['parent_password', DI::l10n()->t('Parent Password:'), '', DI::l10n()->t('Please enter the password of the parent account to legitimize your request.')] '$parent_password' => ['parent_password', DI::l10n()->t('Parent Password:'), '', DI::l10n()->t('Please enter the password of the parent account to legitimize your request.')]
@ -191,7 +191,7 @@ class Register extends BaseModule
DI::baseUrl()->redirect('register?' . http_build_query($regdata)); DI::baseUrl()->redirect('register?' . http_build_query($regdata));
} }
$max_dailies = intval(Config::get('system', 'max_daily_registrations')); $max_dailies = intval(DI::config()->get('system', 'max_daily_registrations'));
if ($max_dailies) { if ($max_dailies) {
$count = DBA::count('user', ['`register_date` > UTC_TIMESTAMP - INTERVAL 1 day']); $count = DBA::count('user', ['`register_date` > UTC_TIMESTAMP - INTERVAL 1 day']);
if ($count >= $max_dailies) { if ($count >= $max_dailies) {
@ -199,7 +199,7 @@ class Register extends BaseModule
} }
} }
switch (Config::get('config', 'register_policy')) { switch (DI::config()->get('config', 'register_policy')) {
case self::OPEN: case self::OPEN:
$blocked = 0; $blocked = 0;
$verified = 1; $verified = 1;
@ -272,7 +272,7 @@ class Register extends BaseModule
$base_url = DI::baseUrl()->get(); $base_url = DI::baseUrl()->get();
if ($netpublish && intval(Config::get('config', 'register_policy')) !== self::APPROVE) { if ($netpublish && intval(DI::config()->get('config', 'register_policy')) !== self::APPROVE) {
$url = $base_url . '/profile/' . $user['nickname']; $url = $base_url . '/profile/' . $user['nickname'];
Worker::add(PRIORITY_LOW, 'Directory', $url); Worker::add(PRIORITY_LOW, 'Directory', $url);
} }
@ -283,11 +283,11 @@ class Register extends BaseModule
DI::baseUrl()->redirect('delegation'); DI::baseUrl()->redirect('delegation');
} }
$using_invites = Config::get('system', 'invitation_only'); $using_invites = DI::config()->get('system', 'invitation_only');
$num_invites = Config::get('system', 'number_invites'); $num_invites = DI::config()->get('system', 'number_invites');
$invite_id = (!empty($_POST['invite_id']) ? Strings::escapeTags(trim($_POST['invite_id'])) : ''); $invite_id = (!empty($_POST['invite_id']) ? Strings::escapeTags(trim($_POST['invite_id'])) : '');
if (intval(Config::get('config', 'register_policy')) === self::OPEN) { if (intval(DI::config()->get('config', 'register_policy')) === self::OPEN) {
if ($using_invites && $invite_id) { if ($using_invites && $invite_id) {
Model\Register::deleteByHash($invite_id); Model\Register::deleteByHash($invite_id);
DI::pConfig()->set($user['uid'], 'system', 'invites_remaining', $num_invites); DI::pConfig()->set($user['uid'], 'system', 'invites_remaining', $num_invites);
@ -298,7 +298,7 @@ class Register extends BaseModule
$res = Model\User::sendRegisterOpenEmail( $res = Model\User::sendRegisterOpenEmail(
DI::l10n()->withLang($arr['language']), DI::l10n()->withLang($arr['language']),
$user, $user,
Config::get('config', 'sitename'), DI::config()->get('config', 'sitename'),
$base_url, $base_url,
$result['password'] $result['password']
); );
@ -317,8 +317,8 @@ class Register extends BaseModule
info(DI::l10n()->t('Registration successful.')); info(DI::l10n()->t('Registration successful.'));
DI::baseUrl()->redirect(); DI::baseUrl()->redirect();
} }
} elseif (intval(Config::get('config', 'register_policy')) === self::APPROVE) { } elseif (intval(DI::config()->get('config', 'register_policy')) === self::APPROVE) {
if (!strlen(Config::get('config', 'admin_email'))) { if (!strlen(DI::config()->get('config', 'admin_email'))) {
notice(DI::l10n()->t('Your registration can not be processed.')); notice(DI::l10n()->t('Your registration can not be processed.'));
DI::baseUrl()->redirect(); DI::baseUrl()->redirect();
} }
@ -331,7 +331,7 @@ class Register extends BaseModule
DI::baseUrl()->redirect('register/'); DI::baseUrl()->redirect('register/');
} }
Model\Register::createForApproval($user['uid'], Config::get('system', 'language'), $_POST['permonlybox']); Model\Register::createForApproval($user['uid'], DI::config()->get('system', 'language'), $_POST['permonlybox']);
// invite system // invite system
if ($using_invites && $invite_id) { if ($using_invites && $invite_id) {
@ -343,7 +343,7 @@ class Register extends BaseModule
$admins_stmt = DBA::select( $admins_stmt = DBA::select(
'user', 'user',
['uid', 'language', 'email'], ['uid', 'language', 'email'],
['email' => explode(',', str_replace(' ', '', Config::get('config', 'admin_email')))] ['email' => explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email')))]
); );
// send notification to admins // send notification to admins
@ -368,7 +368,7 @@ class Register extends BaseModule
// send notification to the user, that the registration is pending // send notification to the user, that the registration is pending
Model\User::sendRegisterPendingEmail( Model\User::sendRegisterPendingEmail(
$user, $user,
Config::get('config', 'sitename'), DI::config()->get('config', 'sitename'),
$base_url, $base_url,
$result['password'] $result['password']
); );

View file

@ -26,25 +26,25 @@ class Index extends BaseSearchModule
{ {
$search = (!empty($_GET['q']) ? Strings::escapeTags(trim(rawurldecode($_GET['q']))) : ''); $search = (!empty($_GET['q']) ? Strings::escapeTags(trim(rawurldecode($_GET['q']))) : '');
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.')); throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
} }
if (Config::get('system', 'local_search') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'local_search') && !Session::isAuthenticated()) {
$e = new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a search.')); $e = new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a search.'));
$e->httpdesc = DI::l10n()->t('Public access denied.'); $e->httpdesc = DI::l10n()->t('Public access denied.');
throw $e; throw $e;
} }
if (Config::get('system', 'permit_crawling') && !Session::isAuthenticated()) { if (DI::config()->get('system', 'permit_crawling') && !Session::isAuthenticated()) {
// Default values: // Default values:
// 10 requests are "free", after the 11th only a call per minute is allowed // 10 requests are "free", after the 11th only a call per minute is allowed
$free_crawls = intval(Config::get('system', 'free_crawls')); $free_crawls = intval(DI::config()->get('system', 'free_crawls'));
if ($free_crawls == 0) if ($free_crawls == 0)
$free_crawls = 10; $free_crawls = 10;
$crawl_permit_period = intval(Config::get('system', 'crawl_permit_period')); $crawl_permit_period = intval(DI::config()->get('system', 'crawl_permit_period'));
if ($crawl_permit_period == 0) if ($crawl_permit_period == 0)
$crawl_permit_period = 10; $crawl_permit_period = 10;
@ -112,7 +112,7 @@ class Index extends BaseSearchModule
} }
} }
$tag = $tag || Config::get('system', 'only_tag_search'); $tag = $tag || DI::config()->get('system', 'only_tag_search');
// Here is the way permissions work in the search module... // Here is the way permissions work in the search module...
// Only public posts can be shown // Only public posts can be shown

View file

@ -28,7 +28,7 @@ class Login extends BaseModule
DI::baseUrl()->redirect(); DI::baseUrl()->redirect();
} }
return self::form(Session::get('return_path'), intval(Config::get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED); return self::form(Session::get('return_path'), intval(DI::config()->get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED);
} }
public static function post(array $parameters = []) public static function post(array $parameters = [])
@ -76,7 +76,7 @@ class Login extends BaseModule
{ {
$o = ''; $o = '';
$noid = Config::get('system', 'no_openid'); $noid = DI::config()->get('system', 'no_openid');
if ($noid) { if ($noid) {
Session::remove('openid_identity'); Session::remove('openid_identity');

View file

@ -48,8 +48,8 @@ class Tos extends BaseModule
**/ **/
public static function init(array $parameters = []) public static function init(array $parameters = [])
{ {
if (strlen(Config::get('system','singleuser'))) { if (strlen(DI::config()->get('system','singleuser'))) {
DI::baseUrl()->redirect('profile/' . Config::get('system','singleuser')); DI::baseUrl()->redirect('profile/' . DI::config()->get('system','singleuser'));
} }
} }
@ -67,11 +67,11 @@ class Tos extends BaseModule
*/ */
public static function content(array $parameters = []) { public static function content(array $parameters = []) {
$tpl = Renderer::getMarkupTemplate('tos.tpl'); $tpl = Renderer::getMarkupTemplate('tos.tpl');
if (Config::get('system', 'tosdisplay')) { if (DI::config()->get('system', 'tosdisplay')) {
return Renderer::replaceMacros($tpl, [ return Renderer::replaceMacros($tpl, [
'$title' => DI::l10n()->t('Terms of Service'), '$title' => DI::l10n()->t('Terms of Service'),
'$tostext' => BBCode::convert(Config::get('system', 'tostext')), '$tostext' => BBCode::convert(DI::config()->get('system', 'tostext')),
'$displayprivstatement' => Config::get('system', 'tosprivstatement'), '$displayprivstatement' => DI::config()->get('system', 'tosprivstatement'),
'$privstatementtitle' => DI::l10n()->t('Privacy Statement'), '$privstatementtitle' => DI::l10n()->t('Privacy Statement'),
'$privacy_operate' => DI::l10n()->t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.'), '$privacy_operate' => DI::l10n()->t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.'),
'$privacy_distribute' => DI::l10n()->t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.'), '$privacy_distribute' => DI::l10n()->t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.'),

View file

@ -151,7 +151,7 @@ class FKOAuthDataStore extends OAuthDataStore
$ret = null; $ret = null;
// get user for this verifier // get user for this verifier
$uverifier = Config::get("oauth", $verifier); $uverifier = DI::config()->get("oauth", $verifier);
Logger::log(__function__ . ":" . $verifier . "," . $uverifier); Logger::log(__function__ . ":" . $verifier . "," . $uverifier);
if (is_null($verifier) || ($uverifier !== false)) { if (is_null($verifier) || ($uverifier !== false)) {

View file

@ -109,7 +109,7 @@ class Probe
$ssl_url = "https://".$host."/.well-known/host-meta"; $ssl_url = "https://".$host."/.well-known/host-meta";
$url = "http://".$host."/.well-known/host-meta"; $url = "http://".$host."/.well-known/host-meta";
$xrd_timeout = Config::get('system', 'xrd_timeout', 20); $xrd_timeout = DI::config()->get('system', 'xrd_timeout', 20);
Logger::log("Probing for ".$host, Logger::DEBUG); Logger::log("Probing for ".$host, Logger::DEBUG);
$xrd = null; $xrd = null;
@ -859,7 +859,7 @@ class Probe
*/ */
private static function webfinger($url, $type) private static function webfinger($url, $type)
{ {
$xrd_timeout = Config::get('system', 'xrd_timeout', 20); $xrd_timeout = DI::config()->get('system', 'xrd_timeout', 20);
$curlResult = Network::curl($url, false, ['timeout' => $xrd_timeout, 'accept_content' => $type]); $curlResult = Network::curl($url, false, ['timeout' => $xrd_timeout, 'accept_content' => $type]);
if ($curlResult->isTimeout()) { if ($curlResult->isTimeout()) {

View file

@ -115,7 +115,7 @@ class Image
*/ */
switch ($this->getType()) { switch ($this->getType()) {
case "image/png": case "image/png":
$quality = Config::get('system', 'png_quality'); $quality = DI::config()->get('system', 'png_quality');
if ((! $quality) || ($quality > 9)) { if ((! $quality) || ($quality > 9)) {
$quality = PNG_QUALITY; $quality = PNG_QUALITY;
} }
@ -131,7 +131,7 @@ class Image
$this->image->setCompressionQuality($quality); $this->image->setCompressionQuality($quality);
break; break;
case "image/jpeg": case "image/jpeg":
$quality = Config::get('system', 'jpeg_quality'); $quality = DI::config()->get('system', 'jpeg_quality');
if ((! $quality) || ($quality > 100)) { if ((! $quality) || ($quality > 100)) {
$quality = JPEG_QUALITY; $quality = JPEG_QUALITY;
} }
@ -652,14 +652,14 @@ class Image
switch ($this->getType()) { switch ($this->getType()) {
case "image/png": case "image/png":
$quality = Config::get('system', 'png_quality'); $quality = DI::config()->get('system', 'png_quality');
if ((!$quality) || ($quality > 9)) { if ((!$quality) || ($quality > 9)) {
$quality = PNG_QUALITY; $quality = PNG_QUALITY;
} }
imagepng($this->image, null, $quality); imagepng($this->image, null, $quality);
break; break;
case "image/jpeg": case "image/jpeg":
$quality = Config::get('system', 'jpeg_quality'); $quality = DI::config()->get('system', 'jpeg_quality');
if ((!$quality) || ($quality > 100)) { if ((!$quality) || ($quality > 100)) {
$quality = JPEG_QUALITY; $quality = JPEG_QUALITY;
} }

View file

@ -374,14 +374,14 @@ class Post
$ago = Temporal::getRelativeDate($item['created']); $ago = Temporal::getRelativeDate($item['created']);
$ago_received = Temporal::getRelativeDate($item['received']); $ago_received = Temporal::getRelativeDate($item['received']);
if (Config::get('system', 'show_received') && (abs(strtotime($item['created']) - strtotime($item['received'])) > Config::get('system', 'show_received_seconds')) && ($ago != $ago_received)) { if (DI::config()->get('system', 'show_received') && (abs(strtotime($item['created']) - strtotime($item['received'])) > DI::config()->get('system', 'show_received_seconds')) && ($ago != $ago_received)) {
$ago = DI::l10n()->t('%s (Received %s)', $ago, $ago_received); $ago = DI::l10n()->t('%s (Received %s)', $ago, $ago_received);
} }
$tmp_item = [ $tmp_item = [
'template' => $this->getTemplate(), 'template' => $this->getTemplate(),
'type' => implode("", array_slice(explode("/", $item['verb']), -1)), 'type' => implode("", array_slice(explode("/", $item['verb']), -1)),
'suppress_tags' => Config::get('system', 'suppress_tags'), 'suppress_tags' => DI::config()->get('system', 'suppress_tags'),
'tags' => $tags['tags'], 'tags' => $tags['tags'],
'hashtags' => $tags['hashtags'], 'hashtags' => $tags['hashtags'],
'mentions' => $tags['mentions'], 'mentions' => $tags['mentions'],

View file

@ -897,7 +897,7 @@ class Processor
*/ */
private static function getImplicitMentionList(array $parent) private static function getImplicitMentionList(array $parent)
{ {
if (Config::get('system', 'disable_implicit_mentions')) { if (DI::config()->get('system', 'disable_implicit_mentions')) {
return []; return [];
} }
@ -939,7 +939,7 @@ class Processor
*/ */
private static function removeImplicitMentionsFromBody($body, array $potential_mentions) private static function removeImplicitMentionsFromBody($body, array $potential_mentions)
{ {
if (Config::get('system', 'disable_implicit_mentions')) { if (DI::config()->get('system', 'disable_implicit_mentions')) {
return $body; return $body;
} }
@ -962,7 +962,7 @@ class Processor
private static function convertImplicitMentionsInTags($activity_tags, array $potential_mentions) private static function convertImplicitMentionsInTags($activity_tags, array $potential_mentions)
{ {
if (Config::get('system', 'disable_implicit_mentions')) { if (DI::config()->get('system', 'disable_implicit_mentions')) {
return $activity_tags; return $activity_tags;
} }

View file

@ -363,11 +363,11 @@ class Transmitter
} }
} }
if (Config::get('system', 'ap_always_bcc')) { if (DI::config()->get('system', 'ap_always_bcc')) {
$always_bcc = true; $always_bcc = true;
} }
if (self::isAnnounce($item) || Config::get('debug', 'total_ap_delivery')) { if (self::isAnnounce($item) || DI::config()->get('debug', 'total_ap_delivery')) {
// Will be activated in a later step // Will be activated in a later step
$networks = Protocol::FEDERATED; $networks = Protocol::FEDERATED;
} else { } else {
@ -548,7 +548,7 @@ class Transmitter
{ {
$inboxes = []; $inboxes = [];
if (Config::get('debug', 'total_ap_delivery')) { if (DI::config()->get('debug', 'total_ap_delivery')) {
// Will be activated in a later step // Will be activated in a later step
$networks = Protocol::FEDERATED; $networks = Protocol::FEDERATED;
} else { } else {
@ -1364,7 +1364,7 @@ class Transmitter
} }
// And finally just use the system language // And finally just use the system language
return Config::get('system', 'language'); return DI::config()->get('system', 'language');
} }
/** /**
@ -1689,7 +1689,7 @@ class Transmitter
if (empty($uid)) { if (empty($uid)) {
// Fetch the list of administrators // Fetch the list of administrators
$admin_mail = explode(',', str_replace(' ', '', Config::get('config', 'admin_email'))); $admin_mail = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email')));
// We need to use some user as a sender. It doesn't care who it will send. We will use an administrator account. // We need to use some user as a sender. It doesn't care who it will send. We will use an administrator account.
$condition = ['verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false, 'email' => $admin_mail]; $condition = ['verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false, 'email' => $admin_mail];
@ -1837,7 +1837,7 @@ class Transmitter
private static function prependMentions($body, array $permission_block) private static function prependMentions($body, array $permission_block)
{ {
if (Config::get('system', 'disable_implicit_mentions')) { if (DI::config()->get('system', 'disable_implicit_mentions')) {
return $body; return $body;
} }

View file

@ -489,7 +489,7 @@ class DFRN
{ {
/* get site pubkey. this could be a new installation with no site keys*/ /* get site pubkey. this could be a new installation with no site keys*/
$pubkey = Config::get('system', 'site_pubkey'); $pubkey = DI::config()->get('system', 'site_pubkey');
if (! $pubkey) { if (! $pubkey) {
$res = Crypto::newKeypair(1024); $res = Crypto::newKeypair(1024);
Config::set('system', 'site_prvkey', $res['prvkey']); Config::set('system', 'site_prvkey', $res['prvkey']);
@ -527,7 +527,7 @@ class DFRN
XML::addElement($doc, $relocate, "dfrn:confirm", $owner['confirm']); XML::addElement($doc, $relocate, "dfrn:confirm", $owner['confirm']);
XML::addElement($doc, $relocate, "dfrn:notify", $owner['notify']); XML::addElement($doc, $relocate, "dfrn:notify", $owner['notify']);
XML::addElement($doc, $relocate, "dfrn:poll", $owner['poll']); XML::addElement($doc, $relocate, "dfrn:poll", $owner['poll']);
XML::addElement($doc, $relocate, "dfrn:sitepubkey", Config::get('system', 'site_pubkey')); XML::addElement($doc, $relocate, "dfrn:sitepubkey", DI::config()->get('system', 'site_pubkey'));
$root->appendChild($relocate); $root->appendChild($relocate);
@ -1192,12 +1192,12 @@ class DFRN
$idtosend = '1:' . $orig_id; $idtosend = '1:' . $orig_id;
} }
$rino = Config::get('system', 'rino_encrypt'); $rino = DI::config()->get('system', 'rino_encrypt');
$rino = intval($rino); $rino = intval($rino);
Logger::log("Local rino version: ". $rino, Logger::DEBUG); Logger::log("Local rino version: ". $rino, Logger::DEBUG);
$ssl_val = intval(Config::get('system', 'ssl_policy')); $ssl_val = intval(DI::config()->get('system', 'ssl_policy'));
switch ($ssl_val) { switch ($ssl_val) {
case BaseURL::SSL_POLICY_FULL: case BaseURL::SSL_POLICY_FULL:

View file

@ -91,7 +91,7 @@ class Diaspora
$serverlist = []; $serverlist = [];
// Fetching relay servers // Fetching relay servers
$serverdata = Config::get("system", "relay_server"); $serverdata = DI::config()->get("system", "relay_server");
if (!empty($serverdata)) { if (!empty($serverdata)) {
$servers = explode(",", $serverdata); $servers = explode(",", $serverdata);
@ -100,7 +100,7 @@ class Diaspora
} }
} }
if (Config::get("system", "relay_directly", false)) { if (DI::config()->get("system", "relay_directly", false)) {
// We distribute our stuff based on the parent to ensure that the thread will be complete // We distribute our stuff based on the parent to ensure that the thread will be complete
$parent = Item::selectFirst(['parent'], ['id' => $item_id]); $parent = Item::selectFirst(['parent'], ['id' => $item_id]);
if (!DBA::isResult($parent)) { if (!DBA::isResult($parent)) {
@ -668,7 +668,7 @@ class Diaspora
*/ */
public static function dispatchPublic($msg) public static function dispatchPublic($msg)
{ {
$enabled = intval(Config::get("system", "diaspora_enabled")); $enabled = intval(DI::config()->get("system", "diaspora_enabled"));
if (!$enabled) { if (!$enabled) {
Logger::log("diaspora is disabled"); Logger::log("diaspora is disabled");
return false; return false;
@ -3133,7 +3133,7 @@ class Diaspora
*/ */
private static function transmit(array $owner, array $contact, $envelope, $public_batch, $guid = "") private static function transmit(array $owner, array $contact, $envelope, $public_batch, $guid = "")
{ {
$enabled = intval(Config::get("system", "diaspora_enabled")); $enabled = intval(DI::config()->get("system", "diaspora_enabled"));
if (!$enabled) { if (!$enabled) {
return 200; return 200;
} }
@ -3160,7 +3160,7 @@ class Diaspora
Logger::log("transmit: ".$logid."-".$guid." ".$dest_url); Logger::log("transmit: ".$logid."-".$guid." ".$dest_url);
if (!intval(Config::get("system", "diaspora_test"))) { if (!intval(DI::config()->get("system", "diaspora_test"))) {
$content_type = (($public_batch) ? "application/magic-envelope+xml" : "application/json"); $content_type = (($public_batch) ? "application/magic-envelope+xml" : "application/json");
$postResult = Network::post($dest_url."/", $envelope, ["Content-Type: ".$content_type]); $postResult = Network::post($dest_url."/", $envelope, ["Content-Type: ".$content_type]);
@ -3772,7 +3772,7 @@ class Diaspora
if ( if (
$item['author-id'] != $thread_parent_item['author-id'] $item['author-id'] != $thread_parent_item['author-id']
&& (empty($item['uid']) || !Feature::isEnabled($item['uid'], 'explicit_mentions')) && (empty($item['uid']) || !Feature::isEnabled($item['uid'], 'explicit_mentions'))
&& !Config::get('system', 'disable_implicit_mentions') && !DI::config()->get('system', 'disable_implicit_mentions')
) { ) {
$body = self::prependParentAuthorMention($body, $thread_parent_item['author-link']); $body = self::prependParentAuthorMention($body, $thread_parent_item['author-link']);
} }

View file

@ -1289,7 +1289,7 @@ class OStatus
XML::addElement($doc, $root, "generator", FRIENDICA_PLATFORM, $attributes); XML::addElement($doc, $root, "generator", FRIENDICA_PLATFORM, $attributes);
XML::addElement($doc, $root, "id", DI::baseUrl() . "/profile/" . $owner["nick"]); XML::addElement($doc, $root, "id", DI::baseUrl() . "/profile/" . $owner["nick"]);
XML::addElement($doc, $root, "title", $title); XML::addElement($doc, $root, "title", $title);
XML::addElement($doc, $root, "subtitle", sprintf("Updates from %s on %s", $owner["name"], Config::get('config', 'sitename'))); XML::addElement($doc, $root, "subtitle", sprintf("Updates from %s on %s", $owner["name"], DI::config()->get('config', 'sitename')));
XML::addElement($doc, $root, "logo", $owner["photo"]); XML::addElement($doc, $root, "logo", $owner["photo"]);
XML::addElement($doc, $root, "updated", DateTimeFormat::utcNow(DateTimeFormat::ATOM)); XML::addElement($doc, $root, "updated", DateTimeFormat::utcNow(DateTimeFormat::ATOM));
@ -1383,7 +1383,7 @@ class OStatus
break; break;
} }
if (!Config::get('system', 'ostatus_not_attach_preview') && ($siteinfo["type"] != "photo") && isset($siteinfo["image"])) { if (!DI::config()->get('system', 'ostatus_not_attach_preview') && ($siteinfo["type"] != "photo") && isset($siteinfo["image"])) {
$imgdata = Images::getInfoFromURLCached($siteinfo["image"]); $imgdata = Images::getInfoFromURLCached($siteinfo["image"]);
if ($imgdata) { if ($imgdata) {
$attributes = ["rel" => "enclosure", $attributes = ["rel" => "enclosure",
@ -2226,7 +2226,7 @@ class OStatus
$root = self::addHeader($doc, $owner, $filter, $feed_mode); $root = self::addHeader($doc, $owner, $filter, $feed_mode);
foreach ($items as $item) { foreach ($items as $item) {
if (Config::get('system', 'ostatus_debug')) { if (DI::config()->get('system', 'ostatus_debug')) {
$item['body'] .= '🍼'; $item['body'] .= '🍼';
} }
@ -2263,7 +2263,7 @@ class OStatus
$doc = new DOMDocument('1.0', 'utf-8'); $doc = new DOMDocument('1.0', 'utf-8');
$doc->formatOutput = true; $doc->formatOutput = true;
if (Config::get('system', 'ostatus_debug')) { if (DI::config()->get('system', 'ostatus_debug')) {
$item['body'] .= '🐟'; $item['body'] .= '🐟';
} }

View file

@ -295,8 +295,8 @@ class PortableContact
self::discoverServer($data, 2); self::discoverServer($data, 2);
} }
if (Config::get('system', 'poco_discovery') >= self::USERS_GCONTACTS) { if (DI::config()->get('system', 'poco_discovery') >= self::USERS_GCONTACTS) {
$timeframe = Config::get('system', 'poco_discovery_since'); $timeframe = DI::config()->get('system', 'poco_discovery_since');
if ($timeframe == 0) { if ($timeframe == 0) {
$timeframe = 30; $timeframe = 30;
@ -320,7 +320,7 @@ class PortableContact
} }
} }
if (!$success && !empty($data) && Config::get('system', 'poco_discovery') >= self::USERS_GCONTACTS_FALLBACK) { if (!$success && !empty($data) && DI::config()->get('system', 'poco_discovery') >= self::USERS_GCONTACTS_FALLBACK) {
Logger::info("Fetch contacts from users of the server " . $server["nurl"]); Logger::info("Fetch contacts from users of the server " . $server["nurl"]);
self::discoverServerUsers($data, $server); self::discoverServerUsers($data, $server);
} }

View file

@ -240,7 +240,7 @@ class Crypto
'encrypt_key' => false 'encrypt_key' => false
]; ];
$conf = Config::get('system', 'openssl_conf_file'); $conf = DI::config()->get('system', 'openssl_conf_file');
if ($conf) { if ($conf) {
$openssl_options['config'] = $conf; $openssl_options['config'] = $conf;
} }

View file

@ -81,7 +81,7 @@ class Emailer
$multipartMessageBody .= $multipartMessageBody .=
"--" . $mimeBoundary . "--\n"; // message ending "--" . $mimeBoundary . "--\n"; // message ending
if (Config::get("system", "sendmail_params", true)) { if (DI::config()->get("system", "sendmail_params", true)) {
$sendmail_params = '-f ' . $params['fromEmail']; $sendmail_params = '-f ' . $params['fromEmail'];
} else { } else {
$sendmail_params = null; $sendmail_params = null;

View file

@ -50,7 +50,7 @@ class ExAuth
*/ */
public function __construct() public function __construct()
{ {
$this->bDebug = (int) Config::get('jabber', 'debug'); $this->bDebug = (int) DI::config()->get('jabber', 'debug');
openlog('auth_ejabberd', LOG_PID, LOG_USER); openlog('auth_ejabberd', LOG_PID, LOG_USER);
@ -305,7 +305,7 @@ class ExAuth
$this->host = $host; $this->host = $host;
$lockpath = Config::get('jabber', 'lockpath'); $lockpath = DI::config()->get('jabber', 'lockpath');
if (is_null($lockpath)) { if (is_null($lockpath)) {
$this->writeLog(LOG_INFO, 'No lockpath defined.'); $this->writeLog(LOG_INFO, 'No lockpath defined.');
return; return;

View file

@ -241,7 +241,7 @@ class HTTPSignature
$iv = $key = $alg = $data = null; $iv = $key = $alg = $data = null;
if (!$prvkey) { if (!$prvkey) {
$prvkey = Config::get('system', 'prvkey'); $prvkey = DI::config()->get('system', 'prvkey');
} }
$matches = []; $matches = [];

View file

@ -151,7 +151,7 @@ class Network
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@curl_setopt($ch, CURLOPT_USERAGENT, $a->getUserAgent()); @curl_setopt($ch, CURLOPT_USERAGENT, $a->getUserAgent());
$range = intval(Config::get('system', 'curl_range_bytes', 0)); $range = intval(DI::config()->get('system', 'curl_range_bytes', 0));
if ($range > 0) { if ($range > 0) {
@curl_setopt($ch, CURLOPT_RANGE, '0-' . $range); @curl_setopt($ch, CURLOPT_RANGE, '0-' . $range);
@ -173,33 +173,33 @@ class Network
if (!empty($opts['timeout'])) { if (!empty($opts['timeout'])) {
@curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']); @curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']);
} else { } else {
$curl_time = Config::get('system', 'curl_timeout', 60); $curl_time = DI::config()->get('system', 'curl_timeout', 60);
@curl_setopt($ch, CURLOPT_TIMEOUT, intval($curl_time)); @curl_setopt($ch, CURLOPT_TIMEOUT, intval($curl_time));
} }
// by default we will allow self-signed certs // by default we will allow self-signed certs
// but you can override this // but you can override this
$check_cert = Config::get('system', 'verifyssl'); $check_cert = DI::config()->get('system', 'verifyssl');
@curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false)); @curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
if ($check_cert) { if ($check_cert) {
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); @curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
} }
$proxy = Config::get('system', 'proxy'); $proxy = DI::config()->get('system', 'proxy');
if (strlen($proxy)) { if (strlen($proxy)) {
@curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); @curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
@curl_setopt($ch, CURLOPT_PROXY, $proxy); @curl_setopt($ch, CURLOPT_PROXY, $proxy);
$proxyuser = @Config::get('system', 'proxyuser'); $proxyuser = @DI::config()->get('system', 'proxyuser');
if (strlen($proxyuser)) { if (strlen($proxyuser)) {
@curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyuser); @curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyuser);
} }
} }
if (Config::get('system', 'ipv4_resolve', false)) { if (DI::config()->get('system', 'ipv4_resolve', false)) {
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
} }
@ -273,14 +273,14 @@ class Network
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_USERAGENT, $a->getUserAgent()); curl_setopt($ch, CURLOPT_USERAGENT, $a->getUserAgent());
if (Config::get('system', 'ipv4_resolve', false)) { if (DI::config()->get('system', 'ipv4_resolve', false)) {
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
} }
if (intval($timeout)) { if (intval($timeout)) {
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
} else { } else {
$curl_time = Config::get('system', 'curl_timeout', 60); $curl_time = DI::config()->get('system', 'curl_timeout', 60);
curl_setopt($ch, CURLOPT_TIMEOUT, intval($curl_time)); curl_setopt($ch, CURLOPT_TIMEOUT, intval($curl_time));
} }
@ -288,19 +288,19 @@ class Network
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
} }
$check_cert = Config::get('system', 'verifyssl'); $check_cert = DI::config()->get('system', 'verifyssl');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false)); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
if ($check_cert) { if ($check_cert) {
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); @curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
} }
$proxy = Config::get('system', 'proxy'); $proxy = DI::config()->get('system', 'proxy');
if (strlen($proxy)) { if (strlen($proxy)) {
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy); curl_setopt($ch, CURLOPT_PROXY, $proxy);
$proxyuser = Config::get('system', 'proxyuser'); $proxyuser = DI::config()->get('system', 'proxyuser');
if (strlen($proxyuser)) { if (strlen($proxyuser)) {
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyuser); curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyuser);
} }
@ -368,7 +368,7 @@ class Network
*/ */
public static function isUrlValid(string $url) public static function isUrlValid(string $url)
{ {
if (Config::get('system', 'disable_url_validation')) { if (DI::config()->get('system', 'disable_url_validation')) {
return $url; return $url;
} }
@ -399,7 +399,7 @@ class Network
*/ */
public static function isEmailDomainValid(string $addr) public static function isEmailDomainValid(string $addr)
{ {
if (Config::get('system', 'disable_email_validation')) { if (DI::config()->get('system', 'disable_email_validation')) {
return true; return true;
} }
@ -436,7 +436,7 @@ class Network
return false; return false;
} }
$str_allowed = Config::get('system', 'allowed_sites'); $str_allowed = DI::config()->get('system', 'allowed_sites');
if (! $str_allowed) { if (! $str_allowed) {
return true; return true;
} }
@ -480,7 +480,7 @@ class Network
return false; return false;
} }
$domain_blocklist = Config::get('system', 'blocklist', []); $domain_blocklist = DI::config()->get('system', 'blocklist', []);
if (!$domain_blocklist) { if (!$domain_blocklist) {
return false; return false;
} }
@ -511,7 +511,7 @@ class Network
return false; return false;
} }
$str_allowed = Config::get('system', 'allowed_email', ''); $str_allowed = DI::config()->get('system', 'allowed_email', '');
if (empty($str_allowed)) { if (empty($str_allowed)) {
return true; return true;
} }

View file

@ -80,7 +80,7 @@ class Proxy
} }
// Is the proxy disabled? // Is the proxy disabled?
if (Config::get('system', 'proxy_disabled')) { if (DI::config()->get('system', 'proxy_disabled')) {
return $url; return $url;
} }

View file

@ -24,7 +24,7 @@ class CheckVersion
{ {
Logger::log('checkversion: start'); Logger::log('checkversion: start');
$checkurl = Config::get('system', 'check_new_version_url', 'none'); $checkurl = DI::config()->get('system', 'check_new_version_url', 'none');
switch ($checkurl) { switch ($checkurl) {
case 'master': case 'master':

View file

@ -21,9 +21,9 @@ class Cron
{ {
$a = DI::app(); $a = DI::app();
$last = Config::get('system', 'last_cron'); $last = DI::config()->get('system', 'last_cron');
$poll_interval = intval(Config::get('system', 'cron_interval')); $poll_interval = intval(DI::config()->get('system', 'cron_interval'));
if ($last) { if ($last) {
$next = $last + ($poll_interval * 60); $next = $last + ($poll_interval * 60);
@ -60,7 +60,7 @@ class Cron
Worker::add(PRIORITY_LOW, "CronJobs", "repair_database"); Worker::add(PRIORITY_LOW, "CronJobs", "repair_database");
// once daily run birthday_updates and then expire in background // once daily run birthday_updates and then expire in background
$d1 = Config::get('system', 'last_expire_day'); $d1 = DI::config()->get('system', 'last_expire_day');
$d2 = intval(DateTimeFormat::utcNow('d')); $d2 = intval(DateTimeFormat::utcNow('d'));
// Daily cron calls // Daily cron calls
@ -90,13 +90,13 @@ class Cron
} }
// Hourly cron calls // Hourly cron calls
if (Config::get('system', 'last_cron_hourly', 0) + 3600 < time()) { if (DI::config()->get('system', 'last_cron_hourly', 0) + 3600 < time()) {
// Delete all done workerqueue entries // Delete all done workerqueue entries
DBA::delete('workerqueue', ['`done` AND `executed` < UTC_TIMESTAMP() - INTERVAL 1 HOUR']); DBA::delete('workerqueue', ['`done` AND `executed` < UTC_TIMESTAMP() - INTERVAL 1 HOUR']);
// Optimizing this table only last seconds // Optimizing this table only last seconds
if (Config::get('system', 'optimize_workerqueue', false)) { if (DI::config()->get('system', 'optimize_workerqueue', false)) {
DBA::e("OPTIMIZE TABLE `workerqueue`"); DBA::e("OPTIMIZE TABLE `workerqueue`");
} }
@ -169,7 +169,7 @@ class Cron
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
private static function pollContacts() { private static function pollContacts() {
$min_poll_interval = Config::get('system', 'min_poll_interval', 1); $min_poll_interval = DI::config()->get('system', 'min_poll_interval', 1);
Addon::reload(); Addon::reload();
@ -188,7 +188,7 @@ class Cron
// Only poll from those with suitable relationships, // Only poll from those with suitable relationships,
// and which have a polling address and ignore Diaspora since // and which have a polling address and ignore Diaspora since
// we are unable to match those posts with a Diaspora GUID and prevent duplicates. // we are unable to match those posts with a Diaspora GUID and prevent duplicates.
$abandon_days = intval(Config::get('system', 'account_abandon_days')); $abandon_days = intval(DI::config()->get('system', 'account_abandon_days'));
if ($abandon_days < 1) { if ($abandon_days < 1) {
$abandon_days = 0; $abandon_days = 0;
} }

Some files were not shown because too many files have changed in this diff Show more