]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Salmon.php
Rename App Methods
[friendica.git] / src / Protocol / Salmon.php
index 5b0c66fb9d13271fba3bc392d693e0912d92cd4f..b71be6e2fa55b590fa936e0ac782cb1aae6495a5 100644 (file)
@@ -6,6 +6,7 @@ namespace Friendica\Protocol;
 
 use Friendica\Network\Probe;
 use Friendica\Util\Crypto;
+use Friendica\Util\Network;
 use Friendica\Util\XML;
 
 /**
@@ -50,7 +51,7 @@ class Salmon
                                                $ret[$x] = substr($ret[$x], 5);
                                        }
                                } elseif (normalise_link($ret[$x]) == 'http://') {
-                                       $ret[$x] = fetch_url($ret[$x]);
+                                       $ret[$x] = Network::fetchUrl($ret[$x]);
                                }
                        }
                }
@@ -132,13 +133,13 @@ class Salmon
                $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
 
@@ -158,11 +159,11 @@ class Salmon
                        $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) {
@@ -181,11 +182,10 @@ class Salmon
                        $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);
@@ -194,7 +194,7 @@ class Salmon
                        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;
                }