]> git.mxchange.org Git - friendica.git/commitdiff
Replace Logger with $this->logger in Module ActivityPub classes
authorArt4 <art4@wlabs.de>
Mon, 13 Jan 2025 11:41:58 +0000 (11:41 +0000)
committerArt4 <art4@wlabs.de>
Mon, 13 Jan 2025 11:41:58 +0000 (11:41 +0000)
src/Module/ActivityPub/Inbox.php
src/Module/ActivityPub/Objects.php

index 23715ceb21b417e38a926e3c177f53bdd7f6e801..f654b3853b33a6f25fd1f17c4cb7e10349214969 100644 (file)
@@ -7,7 +7,6 @@
 
 namespace Friendica\Module\ActivityPub;
 
-use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
@@ -66,7 +65,7 @@ class Inbox extends BaseApi
                }
 
                if (!HTTPSignature::isValidContentType($this->server['CONTENT_TYPE'] ?? '')) {
-                       Logger::notice('Unexpected content type', ['content-type' => $this->server['CONTENT_TYPE'] ?? '', 'agent' => $this->server['HTTP_USER_AGENT'] ?? '']);
+                       $this->logger->notice('Unexpected content type', ['content-type' => $this->server['CONTENT_TYPE'] ?? '', 'agent' => $this->server['HTTP_USER_AGENT'] ?? '']);
                        throw new \Friendica\Network\HTTPException\UnsupportedMediaTypeException();
                }
 
@@ -78,7 +77,7 @@ class Inbox extends BaseApi
                        }
                        $tempfile = tempnam(System::getTempPath(), $filename);
                        file_put_contents($tempfile, json_encode(['parameters' => $this->parameters, 'header' => $_SERVER, 'body' => $postdata], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
-                       Logger::notice('Incoming message stored', ['file' => $tempfile]);
+                       $this->logger->notice('Incoming message stored', ['file' => $tempfile]);
                }
 
                if (!empty($this->parameters['nickname'])) {
index 9b72a52cee1074a02ad766dd783645847094edce..1fa7b2fec53221fedb02c5681f14a396173b7ad0 100644 (file)
@@ -8,8 +8,6 @@
 namespace Friendica\Module\ActivityPub;
 
 use Friendica\BaseModule;
-use Friendica\Core\Logger;
-use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Contact;
@@ -39,7 +37,7 @@ class Objects extends BaseModule
                $itemuri = DBA::selectFirst('item-uri', ['id'], ['guid' => $this->parameters['guid']]);
 
                if (DBA::isResult($itemuri)) {
-                       Logger::info('Provided GUID found.', ['guid' => $this->parameters['guid'], 'uri-id' => $itemuri['id']]);
+                       $this->logger->info('Provided GUID found.', ['guid' => $this->parameters['guid'], 'uri-id' => $itemuri['id']]);
                } else {
                        // The item URI does not always contain the GUID. This means that we have to search the URL instead
                        $url = DI::baseUrl() . '/' . DI::args()->getQueryString();
@@ -48,9 +46,9 @@ class Objects extends BaseModule
 
                        $itemuri = DBA::selectFirst('item-uri', ['guid', 'id'], ['uri' => [$url, $nurl, $ssl_url]]);
                        if (DBA::isResult($itemuri)) {
-                               Logger::info('URL found.', ['url' => $url, 'guid' => $itemuri['guid'], 'uri-id' => $itemuri['id']]);
+                               $this->logger->info('URL found.', ['url' => $url, 'guid' => $itemuri['guid'], 'uri-id' => $itemuri['id']]);
                        } else {
-                               Logger::info('URL not found.', ['url' => $url]);
+                               $this->logger->info('URL not found.', ['url' => $url]);
                                throw new HTTPException\NotFoundException();
                        }
                }