Make "HTTPRequest::post" dynamic

This commit is contained in:
nupplaPhil 2020-03-04 22:18:27 +01:00
parent a00023fd2a
commit da66214547
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
6 changed files with 6 additions and 18 deletions

View file

@ -11,8 +11,6 @@ use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\DI; use Friendica\DI;
use Friendica\Network\HTTPRequest;
use Friendica\Util\Network;
use Friendica\Util\XML; use Friendica\Util\XML;
function blogger_install() function blogger_install()
@ -226,7 +224,7 @@ EOT;
Logger::log('blogger: data: ' . $xml, Logger::DATA); Logger::log('blogger: data: ' . $xml, Logger::DATA);
if ($bl_blog !== 'test') { 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); Logger::log('posted to blogger: ' . (($x) ? $x : ''), Logger::DEBUG);

View file

@ -14,9 +14,7 @@ use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Network\HTTPRequest;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Util\XML; use Friendica\Util\XML;
function dwpost_install() function dwpost_install()
@ -231,7 +229,7 @@ EOT;
Logger::log('dwpost: data: ' . $xml, Logger::DATA); Logger::log('dwpost: data: ' . $xml, Logger::DATA);
if ($dw_blog !== 'test') { 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); Logger::log('posted to dreamwidth: ' . ($x) ? $x : '', Logger::DEBUG);

View file

@ -12,9 +12,7 @@ use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\DI; use Friendica\DI;
use Friendica\Network\HTTPRequest;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Util\XML; use Friendica\Util\XML;
function ijpost_install() function ijpost_install()
@ -229,7 +227,7 @@ EOT;
Logger::log('ijpost: data: ' . $xml, Logger::DATA); Logger::log('ijpost: data: ' . $xml, Logger::DATA);
if ($ij_blog !== 'test') { 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); Logger::log('posted to insanejournal: ' . $x ? $x : '', Logger::DEBUG);
} }

View file

@ -12,8 +12,6 @@ use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Network\HTTPRequest;
use Friendica\Util\Network;
function libertree_install() function libertree_install()
{ {
@ -256,7 +254,7 @@ function libertree_send(&$a,&$b) {
// 'token' => $ltree_api_token // 'token' => $ltree_api_token
]; ];
$result = HTTPRequest::post($ltree_blog, $params)->getBody(); $result = DI::httpRequest()->post($ltree_blog, $params)->getBody();
Logger::log('libertree: ' . $result); Logger::log('libertree: ' . $result);
} }
} }

View file

@ -12,9 +12,7 @@ use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\DI; use Friendica\DI;
use Friendica\Network\HTTPRequest;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Util\XML; use Friendica\Util\XML;
function ljpost_install() { function ljpost_install() {
@ -241,7 +239,7 @@ EOT;
Logger::log('ljpost: data: ' . $xml, Logger::DATA); Logger::log('ljpost: data: ' . $xml, Logger::DATA);
if ($lj_blog !== 'test') { 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); Logger::log('posted to livejournal: ' . ($x) ? $x : '', Logger::DEBUG);
} }

View file

@ -12,8 +12,6 @@ use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Network\HTTPRequest;
use Friendica\Util\Network;
use Friendica\Util\Strings; use Friendica\Util\Strings;
use Friendica\Util\XML; use Friendica\Util\XML;
@ -339,7 +337,7 @@ EOT;
Logger::log('wppost: data: ' . $xml, Logger::DATA); Logger::log('wppost: data: ' . $xml, Logger::DATA);
if ($wp_blog !== 'test') { 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); Logger::log('posted to wordpress: ' . (($x) ? $x : ''), Logger::DEBUG);
} }