]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Network.php
Refactor dynamic App::getProfiler() to static DI::profiler()
[friendica.git] / src / Util / Network.php
index f222dc22df0b735af42158d5f4e0350dcfe95da1..b19c8af50499c93a3942b345551913822ae89633 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Core\Config;
 use Friendica\Core\Hook;
 use Friendica\Core\Logger;
 use Friendica\Core\System;
+use Friendica\DI;
 use Friendica\Network\CurlResult;
 
 class Network
@@ -233,7 +234,7 @@ class Network
 
                @curl_close($ch);
 
-               $a->getProfiler()->saveTimestamp($stamp1, 'network', System::callstack());
+               DI::profiler()->saveTimestamp($stamp1, 'network', System::callstack());
 
                return $curlResponse;
        }
@@ -325,7 +326,7 @@ class Network
 
                curl_close($ch);
 
-               $a->getProfiler()->saveTimestamp($stamp1, 'network', System::callstack());
+               DI::profiler()->saveTimestamp($stamp1, 'network', System::callstack());
 
                // Very old versions of Lighttpd don't like the "Expect" header, so we remove it when needed
                if ($curlResponse->getReturnCode() == 417) {
@@ -654,7 +655,7 @@ class Network
                $http_code = $curl_info['http_code'];
                curl_close($ch);
 
-               $a->getProfiler()->saveTimestamp($stamp1, "network", System::callstack());
+               DI::profiler()->saveTimestamp($stamp1, "network", System::callstack());
 
                if ($http_code == 0) {
                        return $url;
@@ -696,7 +697,7 @@ class Network
                $body = curl_exec($ch);
                curl_close($ch);
 
-               $a->getProfiler()->saveTimestamp($stamp1, "network", System::callstack());
+               DI::profiler()->saveTimestamp($stamp1, "network", System::callstack());
 
                if (trim($body) == "") {
                        return $url;