Refactor dynamic App::getProfiler() to static DI::profiler()

This commit is contained in:
nupplaPhil 2019-12-15 23:50:35 +01:00
parent e2b2778e0a
commit 181529f3df
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
12 changed files with 22 additions and 30 deletions

View 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;