]> git.mxchange.org Git - friendica.git/blob - include/probe.php
Issue 3857: There is the possibility of a bad handling of dislikes
[friendica.git] / include / probe.php
1 <?php
2
3 use Friendica\Network\Probe;
4
5 /**
6  *
7  * PROBE_DIASPORA has a bias towards returning Diaspora information
8  * while PROBE_NORMAL has a bias towards dfrn/zot - in the case where
9  * an address (such as a Friendica address) supports more than one type
10  * of network.
11  *
12  */
13 define('PROBE_NORMAL',   0);
14 define('PROBE_DIASPORA', 1);
15
16 /**
17  * @brief Probes a network address to discover what kind of protocols we need to communicate with it.
18  *
19  * Warning: this function is a bit touchy and there are some subtle dependencies within the logic flow.
20  * Edit with care.
21  *
22  * @deprecated Use Friendica\Network\Probe instead
23  *
24  * @see Friendica\Network\Probe::uri()
25  *
26  * @param string $url Any URI
27  * @param int $mode One of the PROBE_* constants
28  * @return array Same data array returned by Friendica\Network\Probe::uri()
29  */
30 function probe_url($url, $mode = PROBE_NORMAL) {
31
32         if ($mode == PROBE_DIASPORA) {
33                 $network = NETWORK_DIASPORA;
34         } else {
35                 $network = '';
36         }
37
38         $data = Probe::uri($url, $network);
39
40         return $data;
41 }