Replace deprecated Logger calls
This commit is contained in:
parent
91c843608b
commit
2350c6ab57
1 changed files with 18 additions and 18 deletions
|
@ -30,9 +30,9 @@ use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact;
|
|
||||||
use Friendica\Model\GServer;
|
use Friendica\Model\GServer;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
use Friendica\Model\User;
|
||||||
use Friendica\Protocol\ActivityNamespace;
|
use Friendica\Protocol\ActivityNamespace;
|
||||||
use Friendica\Protocol\ActivityPub;
|
use Friendica\Protocol\ActivityPub;
|
||||||
use Friendica\Protocol\Email;
|
use Friendica\Protocol\Email;
|
||||||
|
@ -177,7 +177,7 @@ class Probe
|
||||||
$host_url = $host;
|
$host_url = $host;
|
||||||
}
|
}
|
||||||
} elseif ($curlResult->isTimeout()) {
|
} elseif ($curlResult->isTimeout()) {
|
||||||
Logger::info('Probing timeout', ['url' => $ssl_url], Logger::DEBUG);
|
Logger::info('Probing timeout', ['url' => $ssl_url]);
|
||||||
self::$istimeout = true;
|
self::$istimeout = true;
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ class Probe
|
||||||
$curlResult = Network::curl($url, false, ['timeout' => $xrd_timeout, 'accept_content' => 'application/xrd+xml']);
|
$curlResult = Network::curl($url, false, ['timeout' => $xrd_timeout, 'accept_content' => 'application/xrd+xml']);
|
||||||
$connection_error = ($curlResult->getErrorNumber() == CURLE_COULDNT_CONNECT) || ($curlResult->getReturnCode() == 0);
|
$connection_error = ($curlResult->getErrorNumber() == CURLE_COULDNT_CONNECT) || ($curlResult->getReturnCode() == 0);
|
||||||
if ($curlResult->isTimeout()) {
|
if ($curlResult->isTimeout()) {
|
||||||
Logger::info('Probing timeout', ['url' => $url], Logger::DEBUG);
|
Logger::info('Probing timeout', ['url' => $url]);
|
||||||
self::$istimeout = true;
|
self::$istimeout = true;
|
||||||
return [];
|
return [];
|
||||||
} elseif ($connection_error && $ssl_connection_error) {
|
} elseif ($connection_error && $ssl_connection_error) {
|
||||||
|
@ -199,13 +199,13 @@ class Probe
|
||||||
$host_url = 'http://'.$host;
|
$host_url = 'http://'.$host;
|
||||||
}
|
}
|
||||||
if (!is_object($xrd)) {
|
if (!is_object($xrd)) {
|
||||||
Logger::log("No xrd object found for ".$host, Logger::DEBUG);
|
Logger::info('No xrd object found', ['host' => $host]);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$links = XML::elementToArray($xrd);
|
$links = XML::elementToArray($xrd);
|
||||||
if (!isset($links["xrd"]["link"])) {
|
if (!isset($links["xrd"]["link"])) {
|
||||||
Logger::log("No xrd data found for ".$host, Logger::DEBUG);
|
Logger::info('No xrd data found', ['host' => $host]);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ class Probe
|
||||||
|
|
||||||
self::$baseurl = $host_url;
|
self::$baseurl = $host_url;
|
||||||
|
|
||||||
Logger::log("Probing successful for ".$host, Logger::DEBUG);
|
Logger::info('Probing successful', ['host' => $host]);
|
||||||
|
|
||||||
return $lrdd;
|
return $lrdd;
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ class Probe
|
||||||
$profile_link = '';
|
$profile_link = '';
|
||||||
|
|
||||||
$links = self::lrdd($webbie);
|
$links = self::lrdd($webbie);
|
||||||
Logger::log('webfingerDfrn: '.$webbie.':'.print_r($links, true), Logger::DATA);
|
Logger::debug('Result', ['url' => $webbie, 'links' => $links]);
|
||||||
if (!empty($links) && is_array($links)) {
|
if (!empty($links) && is_array($links)) {
|
||||||
foreach ($links as $link) {
|
foreach ($links as $link) {
|
||||||
if ($link['@attributes']['rel'] === ActivityNamespace::DFRN) {
|
if ($link['@attributes']['rel'] === ActivityNamespace::DFRN) {
|
||||||
|
@ -294,7 +294,7 @@ class Probe
|
||||||
$webfinger = $data['webfinger'];
|
$webfinger = $data['webfinger'];
|
||||||
|
|
||||||
if (empty($webfinger["links"])) {
|
if (empty($webfinger["links"])) {
|
||||||
Logger::log("No webfinger links found for ".$uri, Logger::DEBUG);
|
Logger::info('No webfinger links found', ['uri' => $uri]);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -892,7 +892,7 @@ class Probe
|
||||||
}
|
}
|
||||||
if (!empty($json['public_forum'])) {
|
if (!empty($json['public_forum'])) {
|
||||||
$data['community'] = $json['public_forum'];
|
$data['community'] = $json['public_forum'];
|
||||||
$data['account-type'] = Contact::PAGE_COMMUNITY;
|
$data['account-type'] = User::PAGE_FLAGS_COMMUNITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($json['profile'])) {
|
if (!empty($json['profile'])) {
|
||||||
|
@ -948,7 +948,7 @@ class Probe
|
||||||
$webfinger = json_decode($data, true);
|
$webfinger = json_decode($data, true);
|
||||||
if (!empty($webfinger)) {
|
if (!empty($webfinger)) {
|
||||||
if (!isset($webfinger["links"])) {
|
if (!isset($webfinger["links"])) {
|
||||||
Logger::log("No json webfinger links for ".$url, Logger::DEBUG);
|
Logger::info('No json webfinger links', ['url' => $url]);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return $webfinger;
|
return $webfinger;
|
||||||
|
@ -957,13 +957,13 @@ class Probe
|
||||||
// If it is not JSON, maybe it is XML
|
// If it is not JSON, maybe it is XML
|
||||||
$xrd = XML::parseString($data, true);
|
$xrd = XML::parseString($data, true);
|
||||||
if (!is_object($xrd)) {
|
if (!is_object($xrd)) {
|
||||||
Logger::log("No webfinger data retrievable for ".$url, Logger::DEBUG);
|
Logger::info('No webfinger data retrievable', ['url' => $url]);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$xrd_arr = XML::elementToArray($xrd);
|
$xrd_arr = XML::elementToArray($xrd);
|
||||||
if (!isset($xrd_arr["xrd"]["link"])) {
|
if (!isset($xrd_arr["xrd"]["link"])) {
|
||||||
Logger::log("No XML webfinger links for ".$url, Logger::DEBUG);
|
Logger::info('No XML webfinger links', ['url' => $url]);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1014,13 +1014,13 @@ class Probe
|
||||||
}
|
}
|
||||||
$content = $curlResult->getBody();
|
$content = $curlResult->getBody();
|
||||||
if (!$content) {
|
if (!$content) {
|
||||||
Logger::log("Empty body for ".$noscrape_url, Logger::DEBUG);
|
Logger::info('Empty body', ['url' => $noscrape_url]);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$json = json_decode($content, true);
|
$json = json_decode($content, true);
|
||||||
if (!is_array($json)) {
|
if (!is_array($json)) {
|
||||||
Logger::log("No json data for ".$noscrape_url, Logger::DEBUG);
|
Logger::info('No json data', ['url' => $noscrape_url]);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1134,7 +1134,7 @@ class Probe
|
||||||
{
|
{
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
Logger::log("Check profile ".$profile_link, Logger::DEBUG);
|
Logger::info('Check profile', ['link' => $profile_link]);
|
||||||
|
|
||||||
// Fetch data via noscrape - this is faster
|
// Fetch data via noscrape - this is faster
|
||||||
$noscrape_url = str_replace(["/hcard/", "/profile/"], "/noscrape/", $profile_link);
|
$noscrape_url = str_replace(["/hcard/", "/profile/"], "/noscrape/", $profile_link);
|
||||||
|
@ -1168,7 +1168,7 @@ class Probe
|
||||||
$prof_data["fn"] = $data['name'] ?? null;
|
$prof_data["fn"] = $data['name'] ?? null;
|
||||||
$prof_data["key"] = $data['pubkey'] ?? null;
|
$prof_data["key"] = $data['pubkey'] ?? null;
|
||||||
|
|
||||||
Logger::log("Result for profile ".$profile_link.": ".print_r($prof_data, true), Logger::DEBUG);
|
Logger::debug('Result', ['link' => $profile_link, 'data' => $prof_data]);
|
||||||
|
|
||||||
return $prof_data;
|
return $prof_data;
|
||||||
}
|
}
|
||||||
|
@ -1919,7 +1919,7 @@ class Probe
|
||||||
}
|
}
|
||||||
|
|
||||||
$msgs = Email::poll($mbox, $uri);
|
$msgs = Email::poll($mbox, $uri);
|
||||||
Logger::log('searching '.$uri.', '.count($msgs).' messages found.', Logger::DEBUG);
|
Logger::info('Messages found', ['uri' => $uri, 'count' => count($msgs)]);
|
||||||
|
|
||||||
if (!count($msgs)) {
|
if (!count($msgs)) {
|
||||||
return [];
|
return [];
|
||||||
|
@ -2002,7 +2002,7 @@ class Probe
|
||||||
|
|
||||||
$fixed = $scheme.$host.$port.$path.$query.$fragment;
|
$fixed = $scheme.$host.$port.$path.$query.$fragment;
|
||||||
|
|
||||||
Logger::log('Base: '.$base.' - Avatar: '.$avatar.' - Fixed: '.$fixed, Logger::DATA);
|
Logger::debug('Avatar fixed', ['base' => $base, 'avatar' => $avatar, 'fixed' => $fixed]);
|
||||||
|
|
||||||
return $fixed;
|
return $fixed;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue