mirror of
https://github.com/friendica/friendica
synced 2025-04-25 21:50:12 +00:00
Move Config::get() to DI::config()->get()
This commit is contained in:
parent
5d294e8be8
commit
6c36fd9e01
126 changed files with 581 additions and 596 deletions
|
@ -897,7 +897,7 @@ class Processor
|
|||
*/
|
||||
private static function getImplicitMentionList(array $parent)
|
||||
{
|
||||
if (Config::get('system', 'disable_implicit_mentions')) {
|
||||
if (DI::config()->get('system', 'disable_implicit_mentions')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@ -939,7 +939,7 @@ class Processor
|
|||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -962,7 +962,7 @@ class Processor
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -363,11 +363,11 @@ class Transmitter
|
|||
}
|
||||
}
|
||||
|
||||
if (Config::get('system', 'ap_always_bcc')) {
|
||||
if (DI::config()->get('system', 'ap_always_bcc')) {
|
||||
$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
|
||||
$networks = Protocol::FEDERATED;
|
||||
} else {
|
||||
|
@ -548,7 +548,7 @@ class Transmitter
|
|||
{
|
||||
$inboxes = [];
|
||||
|
||||
if (Config::get('debug', 'total_ap_delivery')) {
|
||||
if (DI::config()->get('debug', 'total_ap_delivery')) {
|
||||
// Will be activated in a later step
|
||||
$networks = Protocol::FEDERATED;
|
||||
} else {
|
||||
|
@ -1364,7 +1364,7 @@ class Transmitter
|
|||
}
|
||||
|
||||
// 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)) {
|
||||
// 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.
|
||||
$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)
|
||||
{
|
||||
if (Config::get('system', 'disable_implicit_mentions')) {
|
||||
if (DI::config()->get('system', 'disable_implicit_mentions')) {
|
||||
return $body;
|
||||
}
|
||||
|
||||
|
|
|
@ -489,7 +489,7 @@ class DFRN
|
|||
{
|
||||
|
||||
/* 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) {
|
||||
$res = Crypto::newKeypair(1024);
|
||||
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:notify", $owner['notify']);
|
||||
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);
|
||||
|
||||
|
@ -1192,12 +1192,12 @@ class DFRN
|
|||
$idtosend = '1:' . $orig_id;
|
||||
}
|
||||
|
||||
$rino = Config::get('system', 'rino_encrypt');
|
||||
$rino = DI::config()->get('system', 'rino_encrypt');
|
||||
$rino = intval($rino);
|
||||
|
||||
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) {
|
||||
case BaseURL::SSL_POLICY_FULL:
|
||||
|
|
|
@ -91,7 +91,7 @@ class Diaspora
|
|||
$serverlist = [];
|
||||
|
||||
// Fetching relay servers
|
||||
$serverdata = Config::get("system", "relay_server");
|
||||
$serverdata = DI::config()->get("system", "relay_server");
|
||||
|
||||
if (!empty($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
|
||||
$parent = Item::selectFirst(['parent'], ['id' => $item_id]);
|
||||
if (!DBA::isResult($parent)) {
|
||||
|
@ -668,7 +668,7 @@ class Diaspora
|
|||
*/
|
||||
public static function dispatchPublic($msg)
|
||||
{
|
||||
$enabled = intval(Config::get("system", "diaspora_enabled"));
|
||||
$enabled = intval(DI::config()->get("system", "diaspora_enabled"));
|
||||
if (!$enabled) {
|
||||
Logger::log("diaspora is disabled");
|
||||
return false;
|
||||
|
@ -3133,7 +3133,7 @@ class Diaspora
|
|||
*/
|
||||
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) {
|
||||
return 200;
|
||||
}
|
||||
|
@ -3160,7 +3160,7 @@ class Diaspora
|
|||
|
||||
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");
|
||||
|
||||
$postResult = Network::post($dest_url."/", $envelope, ["Content-Type: ".$content_type]);
|
||||
|
@ -3772,7 +3772,7 @@ class Diaspora
|
|||
if (
|
||||
$item['author-id'] != $thread_parent_item['author-id']
|
||||
&& (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']);
|
||||
}
|
||||
|
|
|
@ -1289,7 +1289,7 @@ class OStatus
|
|||
XML::addElement($doc, $root, "generator", FRIENDICA_PLATFORM, $attributes);
|
||||
XML::addElement($doc, $root, "id", DI::baseUrl() . "/profile/" . $owner["nick"]);
|
||||
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, "updated", DateTimeFormat::utcNow(DateTimeFormat::ATOM));
|
||||
|
||||
|
@ -1383,7 +1383,7 @@ class OStatus
|
|||
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"]);
|
||||
if ($imgdata) {
|
||||
$attributes = ["rel" => "enclosure",
|
||||
|
@ -2226,7 +2226,7 @@ class OStatus
|
|||
$root = self::addHeader($doc, $owner, $filter, $feed_mode);
|
||||
|
||||
foreach ($items as $item) {
|
||||
if (Config::get('system', 'ostatus_debug')) {
|
||||
if (DI::config()->get('system', 'ostatus_debug')) {
|
||||
$item['body'] .= '🍼';
|
||||
}
|
||||
|
||||
|
@ -2263,7 +2263,7 @@ class OStatus
|
|||
$doc = new DOMDocument('1.0', 'utf-8');
|
||||
$doc->formatOutput = true;
|
||||
|
||||
if (Config::get('system', 'ostatus_debug')) {
|
||||
if (DI::config()->get('system', 'ostatus_debug')) {
|
||||
$item['body'] .= '🐟';
|
||||
}
|
||||
|
||||
|
|
|
@ -295,8 +295,8 @@ class PortableContact
|
|||
self::discoverServer($data, 2);
|
||||
}
|
||||
|
||||
if (Config::get('system', 'poco_discovery') >= self::USERS_GCONTACTS) {
|
||||
$timeframe = Config::get('system', 'poco_discovery_since');
|
||||
if (DI::config()->get('system', 'poco_discovery') >= self::USERS_GCONTACTS) {
|
||||
$timeframe = DI::config()->get('system', 'poco_discovery_since');
|
||||
|
||||
if ($timeframe == 0) {
|
||||
$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"]);
|
||||
self::discoverServerUsers($data, $server);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue