use Friendica\Network\Probe;
use Friendica\Util\Crypto;
+use Friendica\Util\Network;
use Friendica\Util\XML;
/**
$ret[$x] = substr($ret[$x], 5);
}
} elseif (normalise_link($ret[$x]) == 'http://') {
- $ret[$x] = fetch_url($ret[$x]);
+ $ret[$x] = Network::fetchUrl($ret[$x]);
}
}
}
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
- post_url($url, $salmon, [
+ Network::post($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)
]);
$a = get_app();
- $return_code = $a->get_curl_code();
+ $return_code = Network::getCurl()->getCode();
// check for success, e.g. 2xx
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
- post_url($url, $salmon, [
+ Network::post($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)
]);
- $return_code = $a->get_curl_code();
+ $return_code = Network::getCurl()->getCode();
}
if ($return_code > 299) {
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
- post_url($url, $salmon, [
+ Network::post($url, $salmon, [
'Content-type: application/magic-envelope+xml',
- 'Content-length: ' . strlen($salmon)]
- );
- $return_code = $a->get_curl_code();
+ 'Content-length: ' . strlen($salmon)]);
+ $return_code = Network::getCurl()->getCode();
}
logger('slapper for '.$url.' returned ' . $return_code);
return -1;
}
- if (($return_code == 503) && (stristr($a->get_curl_headers(), 'retry-after'))) {
+ if (($return_code == 503) && (stristr(Network::getCurl()->getHeaders(), 'retry-after'))) {
return -1;
}