]> git.mxchange.org Git - friendica.git/commitdiff
Move post_url
authorAdam Magness <adam.magness@gmail.com>
Sat, 27 Jan 2018 04:24:23 +0000 (23:24 -0500)
committerAdam Magness <adam.magness@gmail.com>
Sat, 27 Jan 2018 04:24:23 +0000 (23:24 -0500)
move post_url function

12 files changed:
include/items.php
include/network.php
mod/dfrn_confirm.php
mod/dfrn_poll.php
mod/match.php
spec/dfrn2_contact_confirmation.svg
src/Protocol/DFRN.php
src/Protocol/Diaspora.php
src/Protocol/Salmon.php
src/Util/Network.php
src/Worker/OnePoll.php
src/Worker/PubSubPublish.php

index edc757dc2e0590a6935e0079cb1a216dc1f66094..a1afbb30625978994ea761c7f9552117fa63f65b 100644 (file)
@@ -22,6 +22,7 @@ use Friendica\Object\Image;
 use Friendica\Protocol\DFRN;
 use Friendica\Protocol\OStatus;
 use Friendica\Protocol\Feed;
+use Friendica\Util\Network;
 use Friendica\Util\ParseUrl;
 
 require_once 'include/bbcode.php';
@@ -1480,7 +1481,7 @@ function subscribe_to_hub($url, $importer, $contact, $hubmode = 'subscribe') {
                dba::update('contact', ['hub-verify' => $verify_token], ['id' => $contact['id']]);
        }
 
-       post_url($url, $params);
+       Network::postURL($url, $params);
 
        logger('subscribe_to_hub: returns: ' . $a->get_curl_code(), LOGGER_DEBUG);
 
index 7f1bbb6d83b7463499191f46380f048a0b55f1da..875597f764e7fccb54f30ddf6eefdcdcb99693bb 100644 (file)
@@ -12,11 +12,6 @@ use Friendica\Object\Image;
 use Friendica\Util\Network;
 use Friendica\Util\XML;
 
-function post_url($url, $params, $headers = null, &$redirects = 0, $timeout = 0)
-{
-       return Network::postURL($url, $params, $headers, $redirects, $timeout);
-}
-
 function xml_status($st, $message = '')
 {
        Network::xmlStatus($st, $message);
index a712e439f725e5ee72c5049040c29b2d6e739174..d3c84c54fa20680c94d7a09f3c72036626e37d10 100644 (file)
@@ -30,6 +30,7 @@ use Friendica\Model\User;
 use Friendica\Network\Probe;
 use Friendica\Protocol\Diaspora;
 use Friendica\Util\Crypto;
+use Friendica\Util\Network;
 
 require_once 'include/enotify.php';
 require_once 'include/items.php';
@@ -220,7 +221,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                         *
                         */
 
-                       $res = post_url($dfrn_confirm, $params, null, $redirects, 120);
+                       $res = Network::postURL($dfrn_confirm, $params, null, $redirects, 120);
 
                        logger(' Confirm: received data: ' . $res, LOGGER_DATA);
 
index 7b0785b6f321e58e27fc72e2dbff84593afae239..0392c2c920e89923aa824b36fe7fb245231f267c 100644 (file)
@@ -490,7 +490,7 @@ function dfrn_poll_content(App $a)
                                        . '&sec=' . $sec
                                );
                        } else {
-                               $s = post_url($r[0]['poll'], [
+                               $s = Network::postURL($r[0]['poll'], [
                                        'dfrn_id' => $encrypted_id,
                                        'type' => 'profile-check',
                                        'dfrn_version' => DFRN_PROTOCOL_VERSION,
index 47b24e9f7e7582b60e63a029bc07d70be442e39c..ad1e00101ea3f3ec465a53e101aa0f3011f61b3e 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Core\System;
 use Friendica\Database\DBM;
 use Friendica\Model\Contact;
 use Friendica\Model\Profile;
+use Friendica\Util\Network;
 
 require_once 'include/text.php';
 require_once 'mod/proxy.php';
@@ -58,9 +59,9 @@ function match_content(App $a)
                }
 
                if (strlen(Config::get('system', 'directory'))) {
-                       $x = post_url(get_server().'/msearch', $params);
+                       $x = Network::postURL(get_server().'/msearch', $params);
                } else {
-                       $x = post_url(System::baseUrl() . '/msearch', $params);
+                       $x = Network::postURL(System::baseUrl() . '/msearch', $params);
                }
 
                $j = json_decode($x);
index bb506a2328efa2f852a624cfb179577d376dbd98..53c2b6c19f5a5206d6bade86a7726b80f49ed5a4 100644 (file)
@@ -69,7 +69,7 @@ text { font:12px Dialog; }
 <text x="29" y="1664" style="font:13px Open Sans">getting transmitted (if $aes_allow -&gt; encrypt the the public key)</text>
 <text x="29" y="1710" style="font:13px Open Sans">     -&gt; add duplex state and page-flags to the params</text>
 <text x="29" y="1756" style="font:13px Open Sans">  -&gt; send params to Bobs dfrn_confirm page ($res = </text>
-<text x="29" y="1779" style="font:13px Open Sans">post_url($dfrn_confirm,$params);</text>
+<text x="29" y="1779" style="font:13px Open Sans">Network::postURL($dfrn_confirm,$params);</text>
 <clipPath id="clip11"><path d="M1041,1319 L1619,1319 L1619,1913 L1041,1913 L1041,1319 Z" /></clipPath>
 <path d="M1050,1320 C1045.5820313,1320 1042,1323.5820313 1042,1328 L1042,1903 C1042,1907.4179688 1045.5820313,1911 1050,1911 L1609,1911 C1613.4179688,1911 1617,1907.4179688 1617,1903 L1617,1328 C1617,1323.5820313 1613.4179688,1320 1609,1320 Z" style="fill:rgb(255,255,3);stroke:none" clip-path="url(#clip11)" />
 <text x="1055" y="1342" style="font:13px Open Sans">dfrn_confirm_post()</text>
index 4289769e4117ee5af4535631d2979dd576b0958f..aed68e704f52e8db2626773b067a6803fde7b50b 100644 (file)
@@ -1333,7 +1333,7 @@ class DFRN
 
                logger('dfrn_deliver: ' . "SENDING: " . print_r($postvars, true), LOGGER_DATA);
 
-               $xml = post_url($contact['notify'], $postvars);
+               $xml = Network::postURL($contact['notify'], $postvars);
 
                logger('dfrn_deliver: ' . "RECEIVED: " . $xml, LOGGER_DATA);
 
index 14bad8e1d93cb57c52b0371ee2454552e1b150b0..2ad4fadb115e472b92decc97792a205465ecff1f 100644 (file)
@@ -3229,7 +3229,7 @@ class Diaspora
                        if (!intval(Config::get("system", "diaspora_test"))) {
                                $content_type = (($public_batch) ? "application/magic-envelope+xml" : "application/json");
 
-                               post_url($dest_url."/", $envelope, ["Content-Type: ".$content_type]);
+                               Network::postURL($dest_url."/", $envelope, ["Content-Type: ".$content_type]);
                                $return_code = $a->get_curl_code();
                        } else {
                                logger("test_mode");
index 3e8d3681693c002852d7d9402d1566048b366718..f49225021e9a11522d4234dde253af54168d55ac 100644 (file)
@@ -133,7 +133,7 @@ class Salmon
                $salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
 
                // slap them
-               post_url($url, $salmon, [
+               Network::postURL($url, $salmon, [
                        'Content-type: application/magic-envelope+xml',
                        'Content-length: ' . strlen($salmon)
                ]);
@@ -159,7 +159,7 @@ class Salmon
                        $salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
 
                        // slap them
-                       post_url($url, $salmon, [
+                       Network::postURL($url, $salmon, [
                                'Content-type: application/magic-envelope+xml',
                                'Content-length: ' . strlen($salmon)
                        ]);
@@ -182,10 +182,9 @@ class Salmon
                        $salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
 
                        // slap them
-                       post_url($url, $salmon, [
+                       Network::postURL($url, $salmon, [
                                'Content-type: application/magic-envelope+xml',
-                               'Content-length: ' . strlen($salmon)]
-                       );
+                               'Content-length: ' . strlen($salmon)]);
                        $return_code = $a->get_curl_code();
                }
 
index ebe6abda4748195fd5bcb3b97d28c35472ad797b..e0400c7f0ab132bc8e11f16506dee1a4264300ec 100644 (file)
@@ -380,7 +380,7 @@ class Network
                        if (filter_var($newurl, FILTER_VALIDATE_URL)) {
                                $redirects++;
                                logger('post_url: redirect ' . $url . ' to ' . $newurl);
-                               return post_url($newurl, $params, $headers, $redirects, $timeout);
+                               return self::postURL($newurl, $params, $headers, $redirects, $timeout);
                        }
                }
 
index 98b5f778698736a2b000f99f77cfa132b28e18ee..b4e7bc20c48e90e3edbd08d622ae607ea171fd32 100644 (file)
@@ -281,7 +281,7 @@ class OnePoll
                        $postvars['dfrn_version'] = DFRN_PROTOCOL_VERSION;
                        $postvars['perm'] = 'rw';
 
-                       $xml = post_url($contact['poll'], $postvars);
+                       $xml = Network::postURL($contact['poll'], $postvars);
 
                } elseif (($contact['network'] === NETWORK_OSTATUS)
                        || ($contact['network'] === NETWORK_DIASPORA)
index 2656cef24b7af5b07adfcd97a5873537b445e6c5..a287e89d33f6e88cecc85667b45949074a87ac5a 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\Core\Config;
 use Friendica\Core\Worker;
 use Friendica\Database\DBM;
 use Friendica\Protocol\OStatus;
+use Friendica\Util\Network;
 
 require_once 'include/items.php';
 
@@ -68,7 +69,7 @@ class PubSubPublish {
 
                logger('POST '.print_r($headers, true)."\n".$params, LOGGER_DEBUG);
 
-               post_url($rr['callback_url'], $params, $headers);
+               Network::postURL($rr['callback_url'], $params, $headers);
                $ret = $a->get_curl_code();
 
                if ($ret >= 200 && $ret <= 299) {