From 20056dc79567248394381a16cc8dd886054d4fc0 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Wed, 4 Mar 2020 22:18:27 +0100 Subject: [PATCH] Make "HTTPRequest::post" dynamic --- blogger/blogger.php | 3 +-- dwpost/dwpost.php | 3 +-- ijpost/ijpost.php | 3 +-- libertree/libertree.php | 3 +-- ljpost/ljpost.php | 3 +-- wppost/wppost.php | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/blogger/blogger.php b/blogger/blogger.php index f17f1b1e9..0d201305f 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -11,7 +11,6 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\DI; -use Friendica\Network\HTTPRequest; use Friendica\Util\XML; function blogger_install() @@ -225,7 +224,7 @@ EOT; Logger::log('blogger: data: ' . $xml, Logger::DATA); if ($bl_blog !== 'test') { - $x = HTTPRequest::post($bl_blog, $xml)->getBody(); + $x = DI::httpRequest()->post($bl_blog, $xml)->getBody(); } Logger::log('posted to blogger: ' . (($x) ? $x : ''), Logger::DEBUG); diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index bb45dd14e..9a973b672 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -15,7 +15,6 @@ use Friendica\Core\Logger; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Tag; -use Friendica\Network\HTTPRequest; use Friendica\Util\DateTimeFormat; use Friendica\Util\XML; @@ -231,7 +230,7 @@ EOT; Logger::log('dwpost: data: ' . $xml, Logger::DATA); if ($dw_blog !== 'test') { - $x = HTTPRequest::post($dw_blog, $xml, ["Content-Type: text/xml"])->getBody(); + $x = DI::httpRequest()->post($dw_blog, $xml, ["Content-Type: text/xml"])->getBody(); } Logger::log('posted to dreamwidth: ' . ($x) ? $x : '', Logger::DEBUG); diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index 1c6b9509f..0619c288a 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -13,7 +13,6 @@ use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\DI; use Friendica\Model\Tag; -use Friendica\Network\HTTPRequest; use Friendica\Util\DateTimeFormat; use Friendica\Util\XML; @@ -229,7 +228,7 @@ EOT; Logger::log('ijpost: data: ' . $xml, Logger::DATA); if ($ij_blog !== 'test') { - $x = HTTPRequest::post($ij_blog, $xml, ["Content-Type: text/xml"])->getBody(); + $x = DI::httpRequest()->post($ij_blog, $xml, ["Content-Type: text/xml"])->getBody(); } Logger::log('posted to insanejournal: ' . $x ? $x : '', Logger::DEBUG); } diff --git a/libertree/libertree.php b/libertree/libertree.php index 23442da20..dfa492235 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -12,7 +12,6 @@ use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Database\DBA; use Friendica\DI; -use Friendica\Network\HTTPRequest; function libertree_install() { @@ -243,7 +242,7 @@ function libertree_send(&$a,&$b) { // 'token' => $ltree_api_token ]; - $result = HTTPRequest::post($ltree_blog, $params)->getBody(); + $result = DI::httpRequest()->post($ltree_blog, $params)->getBody(); Logger::log('libertree: ' . $result); } } diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index 4420775a8..a98087c2d 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -13,7 +13,6 @@ use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\DI; use Friendica\Model\Tag; -use Friendica\Network\HTTPRequest; use Friendica\Util\DateTimeFormat; use Friendica\Util\XML; @@ -241,7 +240,7 @@ EOT; Logger::log('ljpost: data: ' . $xml, Logger::DATA); if ($lj_blog !== 'test') { - $x = HTTPRequest::post($lj_blog, $xml, ["Content-Type: text/xml"])->getBody(); + $x = DI::httpRequest()->post($lj_blog, $xml, ["Content-Type: text/xml"])->getBody(); } Logger::log('posted to livejournal: ' . ($x) ? $x : '', Logger::DEBUG); } diff --git a/wppost/wppost.php b/wppost/wppost.php index 0d860ef57..8cd134109 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -12,7 +12,6 @@ use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Database\DBA; use Friendica\DI; -use Friendica\Network\HTTPRequest; use Friendica\Util\Strings; use Friendica\Util\XML; @@ -338,7 +337,7 @@ EOT; Logger::log('wppost: data: ' . $xml, Logger::DATA); if ($wp_blog !== 'test') { - $x = HTTPRequest::post($wp_blog, $xml)->getBody(); + $x = DI::httpRequest()->post($wp_blog, $xml)->getBody(); } Logger::log('posted to wordpress: ' . (($x) ? $x : ''), Logger::DEBUG); }