Merge pull request #3445 from Hypolite/improvement/move-probe-to-src
Move Probe to src
This commit is contained in:
commit
6680ce1dd7
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\Network\Probe;
|
||||||
|
|
||||||
// Included here for completeness, but this is a very dangerous operation.
|
// Included here for completeness, but this is a very dangerous operation.
|
||||||
// It is the caller's responsibility to confirm the requestor's intent and
|
// It is the caller's responsibility to confirm the requestor's intent and
|
||||||
|
@ -91,11 +92,11 @@ function terminate_friendship($user,$self,$contact) {
|
||||||
/// @TODO Get rid of this, include/datetime.php should care about it by itself
|
/// @TODO Get rid of this, include/datetime.php should care about it by itself
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
require_once('include/datetime.php');
|
require_once 'include/datetime.php';
|
||||||
|
|
||||||
if ($contact['network'] === NETWORK_OSTATUS) {
|
if ($contact['network'] === NETWORK_OSTATUS) {
|
||||||
|
|
||||||
require_once('include/ostatus.php');
|
require_once 'include/ostatus.php';
|
||||||
|
|
||||||
// create an unfollow slap
|
// create an unfollow slap
|
||||||
$item = array();
|
$item = array();
|
||||||
|
@ -104,14 +105,14 @@ function terminate_friendship($user,$self,$contact) {
|
||||||
$slap = ostatus::salmon($item, $user);
|
$slap = ostatus::salmon($item, $user);
|
||||||
|
|
||||||
if ((x($contact,'notify')) && (strlen($contact['notify']))) {
|
if ((x($contact,'notify')) && (strlen($contact['notify']))) {
|
||||||
require_once('include/salmon.php');
|
require_once 'include/salmon.php';
|
||||||
slapper($user,$contact['notify'],$slap);
|
slapper($user,$contact['notify'],$slap);
|
||||||
}
|
}
|
||||||
} elseif ($contact['network'] === NETWORK_DIASPORA) {
|
} elseif ($contact['network'] === NETWORK_DIASPORA) {
|
||||||
require_once('include/diaspora.php');
|
require_once 'include/diaspora.php';
|
||||||
Diaspora::send_unshare($user,$contact);
|
Diaspora::send_unshare($user,$contact);
|
||||||
} elseif ($contact['network'] === NETWORK_DFRN) {
|
} elseif ($contact['network'] === NETWORK_DFRN) {
|
||||||
require_once('include/dfrn.php');
|
require_once 'include/dfrn.php';
|
||||||
dfrn::deliver($user,$contact,'placeholder', 1);
|
dfrn::deliver($user,$contact,'placeholder', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,7 +364,6 @@ function get_contact_details_by_addr($addr, $uid = -1) {
|
||||||
dbesc($addr));
|
dbesc($addr));
|
||||||
|
|
||||||
if (!dbm::is_result($r)) {
|
if (!dbm::is_result($r)) {
|
||||||
require_once('include/Probe.php');
|
|
||||||
$data = Probe::uri($addr);
|
$data = Probe::uri($addr);
|
||||||
|
|
||||||
$profile = get_contact_details_by_url($data['url'], $uid);
|
$profile = get_contact_details_by_url($data['url'], $uid);
|
||||||
|
@ -589,7 +589,6 @@ function get_contact($url, $uid = 0, $no_update = false) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('include/Probe.php');
|
|
||||||
$data = Probe::uri($url);
|
$data = Probe::uri($url);
|
||||||
|
|
||||||
// Last try in gcontact for unsupported networks
|
// Last try in gcontact for unsupported networks
|
||||||
|
@ -706,7 +705,7 @@ function get_contact($url, $uid = 0, $no_update = false) {
|
||||||
*/
|
*/
|
||||||
function posts_from_gcontact(App $a, $gcontact_id) {
|
function posts_from_gcontact(App $a, $gcontact_id) {
|
||||||
|
|
||||||
require_once('include/conversation.php');
|
require_once 'include/conversation.php';
|
||||||
|
|
||||||
// There are no posts with "uid = 0" with connector networks
|
// There are no posts with "uid = 0" with connector networks
|
||||||
// This speeds up the query a lot
|
// This speeds up the query a lot
|
||||||
|
@ -745,7 +744,7 @@ function posts_from_gcontact(App $a, $gcontact_id) {
|
||||||
*/
|
*/
|
||||||
function posts_from_contact_url(App $a, $contact_url) {
|
function posts_from_contact_url(App $a, $contact_url) {
|
||||||
|
|
||||||
require_once('include/conversation.php');
|
require_once 'include/conversation.php';
|
||||||
|
|
||||||
// There are no posts with "uid = 0" with connector networks
|
// There are no posts with "uid = 0" with connector networks
|
||||||
// This speeds up the query a lot
|
// This speeds up the query a lot
|
||||||
|
|
|
@ -4,9 +4,10 @@
|
||||||
* @brief Methods for read and write notifications from/to database
|
* @brief Methods for read and write notifications from/to database
|
||||||
* or for formatting notifications
|
* or for formatting notifications
|
||||||
*/
|
*/
|
||||||
require_once('include/html2plain.php');
|
require_once 'include/html2plain.php';
|
||||||
require_once("include/datetime.php");
|
require_once 'include/probe.php';
|
||||||
require_once("include/bbcode.php");
|
require_once 'include/datetime.php';
|
||||||
|
require_once 'include/bbcode.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Methods for read and write notifications from/to database
|
* @brief Methods for read and write notifications from/to database
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\Network\Probe;
|
||||||
|
|
||||||
use League\HTMLToMarkdown\HtmlConverter;
|
use League\HTMLToMarkdown\HtmlConverter;
|
||||||
|
|
||||||
require_once "include/oembed.php";
|
require_once 'include/oembed.php';
|
||||||
require_once "include/event.php";
|
require_once 'include/event.php';
|
||||||
require_once "library/markdown.php";
|
require_once 'library/markdown.php';
|
||||||
require_once "include/html2bbcode.php";
|
require_once 'include/html2bbcode.php';
|
||||||
require_once "include/bbcode.php";
|
require_once 'include/bbcode.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Callback function to replace a Diaspora style mention in a mention for Friendica
|
* @brief Callback function to replace a Diaspora style mention in a mention for Friendica
|
||||||
|
|
|
@ -2,18 +2,18 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
use Friendica\Network\Probe;
|
||||||
|
|
||||||
function cronjobs_run(&$argv, &$argc){
|
function cronjobs_run(&$argv, &$argc){
|
||||||
global $a;
|
global $a;
|
||||||
|
|
||||||
require_once('include/datetime.php');
|
require_once 'include/datetime.php';
|
||||||
require_once('include/ostatus.php');
|
require_once 'include/ostatus.php';
|
||||||
require_once('include/post_update.php');
|
require_once 'include/post_update.php';
|
||||||
require_once('mod/nodeinfo.php');
|
require_once 'mod/nodeinfo.php';
|
||||||
require_once('include/photos.php');
|
require_once 'include/photos.php';
|
||||||
require_once('include/user.php');
|
require_once 'include/user.php';
|
||||||
require_once('include/socgraph.php');
|
require_once 'include/socgraph.php';
|
||||||
require_once('include/Probe.php');
|
|
||||||
|
|
||||||
// No parameter set? So return
|
// No parameter set? So return
|
||||||
if ($argc <= 1) {
|
if ($argc <= 1) {
|
||||||
|
|
|
@ -3,20 +3,20 @@
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once('include/queue_fn.php');
|
require_once 'include/queue_fn.php';
|
||||||
require_once('include/html2plain.php');
|
require_once 'include/html2plain.php';
|
||||||
require_once('include/Scrape.php');
|
require_once 'include/probe.php';
|
||||||
require_once('include/diaspora.php');
|
require_once 'include/diaspora.php';
|
||||||
require_once('include/ostatus.php');
|
require_once 'include/ostatus.php';
|
||||||
require_once('include/dfrn.php');
|
require_once 'include/dfrn.php';
|
||||||
|
|
||||||
function delivery_run(&$argv, &$argc){
|
function delivery_run(&$argv, &$argc){
|
||||||
global $a;
|
global $a;
|
||||||
|
|
||||||
require_once('include/datetime.php');
|
require_once 'include/datetime.php';
|
||||||
require_once('include/items.php');
|
require_once 'include/items.php';
|
||||||
require_once('include/bbcode.php');
|
require_once 'include/bbcode.php';
|
||||||
require_once('include/email.php');
|
require_once 'include/email.php';
|
||||||
|
|
||||||
if ($argc < 3) {
|
if ($argc < 3) {
|
||||||
return;
|
return;
|
||||||
|
@ -166,7 +166,7 @@ function delivery_run(&$argv, &$argc){
|
||||||
$public_message = true;
|
$public_message = true;
|
||||||
|
|
||||||
if (!($mail || $fsuggest || $relocate)) {
|
if (!($mail || $fsuggest || $relocate)) {
|
||||||
require_once('include/group.php');
|
require_once 'include/group.php';
|
||||||
|
|
||||||
$parent = $items[0];
|
$parent = $items[0];
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once 'include/items.php';
|
require_once 'include/items.php';
|
||||||
require_once 'include/bb2diaspora.php';
|
require_once 'include/bb2diaspora.php';
|
||||||
require_once 'include/Scrape.php';
|
require_once 'include/probe.php';
|
||||||
require_once 'include/Contact.php';
|
require_once 'include/Contact.php';
|
||||||
require_once 'include/Photo.php';
|
require_once 'include/Photo.php';
|
||||||
require_once 'include/socgraph.php';
|
require_once 'include/socgraph.php';
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once('include/socgraph.php');
|
require_once 'include/probe.php';
|
||||||
require_once('include/datetime.php');
|
require_once 'include/socgraph.php';
|
||||||
|
require_once 'include/datetime.php';
|
||||||
|
|
||||||
function discover_poco_run(&$argv, &$argc) {
|
function discover_poco_run(&$argv, &$argc) {
|
||||||
|
|
||||||
|
|
|
@ -83,74 +83,6 @@ function format_event_html($ev, $simple = false) {
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
@TODO old-lost code found?
|
|
||||||
function parse_event($h) {
|
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
|
||||||
require_once('include/html2bbcode');
|
|
||||||
|
|
||||||
$h = '<html><body>' . $h . '</body></html>';
|
|
||||||
|
|
||||||
$ret = array();
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
$dom = HTML5_Parser::parse($h);
|
|
||||||
} catch (DOMException $e) {
|
|
||||||
logger('parse_event: parse error: ' . $e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $dom)
|
|
||||||
return $ret;
|
|
||||||
|
|
||||||
$items = $dom->getElementsByTagName('*');
|
|
||||||
|
|
||||||
foreach ($items as $item) {
|
|
||||||
if (attribute_contains($item->getAttribute('class'), 'vevent')) {
|
|
||||||
$level2 = $item->getElementsByTagName('*');
|
|
||||||
foreach ($level2 as $x) {
|
|
||||||
if (attribute_contains($x->getAttribute('class'),'dtstart') && $x->getAttribute('title')) {
|
|
||||||
$ret['start'] = $x->getAttribute('title');
|
|
||||||
if (! strpos($ret['start'],'Z'))
|
|
||||||
$ret['adjust'] = true;
|
|
||||||
}
|
|
||||||
if (attribute_contains($x->getAttribute('class'),'dtend') && $x->getAttribute('title'))
|
|
||||||
$ret['finish'] = $x->getAttribute('title');
|
|
||||||
|
|
||||||
if (attribute_contains($x->getAttribute('class'),'description'))
|
|
||||||
$ret['desc'] = $x->textContent;
|
|
||||||
if (attribute_contains($x->getAttribute('class'),'location'))
|
|
||||||
$ret['location'] = $x->textContent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// sanitise
|
|
||||||
|
|
||||||
if ((x($ret,'desc')) && ((strpos($ret['desc'],'<') !== false) || (strpos($ret['desc'],'>') !== false))) {
|
|
||||||
$config = HTMLPurifier_Config::createDefault();
|
|
||||||
$config->set('Cache.DefinitionImpl', null);
|
|
||||||
$purifier = new HTMLPurifier($config);
|
|
||||||
$ret['desc'] = html2bbcode($purifier->purify($ret['desc']));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((x($ret,'location')) && ((strpos($ret['location'],'<') !== false) || (strpos($ret['location'],'>') !== false))) {
|
|
||||||
$config = HTMLPurifier_Config::createDefault();
|
|
||||||
$config->set('Cache.DefinitionImpl', null);
|
|
||||||
$purifier = new HTMLPurifier($config);
|
|
||||||
$ret['location'] = html2bbcode($purifier->purify($ret['location']));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (x($ret,'start'))
|
|
||||||
$ret['start'] = datetime_convert('UTC','UTC',$ret['start']);
|
|
||||||
if (x($ret,'finish'))
|
|
||||||
$ret['finish'] = datetime_convert('UTC','UTC',$ret['finish']);
|
|
||||||
|
|
||||||
return $ret;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
function format_event_bbcode($ev) {
|
function format_event_bbcode($ev) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
|
||||||
require_once("include/Scrape.php");
|
require_once 'include/probe.php';
|
||||||
require_once("include/socgraph.php");
|
require_once 'include/socgraph.php';
|
||||||
require_once('include/group.php');
|
require_once 'include/group.php';
|
||||||
require_once('include/salmon.php');
|
require_once 'include/salmon.php';
|
||||||
require_once('include/ostatus.php');
|
require_once 'include/ostatus.php';
|
||||||
require_once("include/Photo.php");
|
require_once 'include/Photo.php';
|
||||||
require_once('include/diaspora.php');
|
require_once 'include/diaspora.php';
|
||||||
|
|
||||||
function update_contact($id) {
|
function update_contact($id) {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
require_once 'include/probe.php';
|
||||||
require_once('include/socgraph.php');
|
require_once 'include/socgraph.php';
|
||||||
require_once('include/datetime.php');
|
require_once 'include/datetime.php';
|
||||||
|
|
||||||
function gprobe_run(&$argv, &$argc){
|
function gprobe_run(&$argv, &$argc){
|
||||||
if ($argc != 2) {
|
if ($argc != 2) {
|
||||||
|
|
|
@ -174,7 +174,7 @@ function send_wallmessage($recipient='', $body='', $subject='', $replyto=''){
|
||||||
$convid = 0;
|
$convid = 0;
|
||||||
$reply = false;
|
$reply = false;
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
require_once 'include/probe.php';
|
||||||
|
|
||||||
$me = probe_url($replyto);
|
$me = probe_url($replyto);
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
use Friendica\Network\Probe;
|
||||||
|
|
||||||
require_once("include/xml.php");
|
require_once("include/xml.php");
|
||||||
require_once('include/Probe.php');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Curl wrapper
|
* @brief Curl wrapper
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once('include/queue_fn.php');
|
require_once 'include/queue_fn.php';
|
||||||
require_once('include/html2plain.php');
|
require_once 'include/html2plain.php';
|
||||||
require_once('include/Scrape.php');
|
require_once 'include/probe.php';
|
||||||
require_once('include/diaspora.php');
|
require_once 'include/diaspora.php';
|
||||||
require_once('include/ostatus.php');
|
require_once 'include/ostatus.php';
|
||||||
require_once('include/salmon.php');
|
require_once 'include/salmon.php';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file was at one time responsible for doing all deliveries, but this caused
|
* This file was at one time responsible for doing all deliveries, but this caused
|
||||||
|
@ -46,10 +46,10 @@ require_once('include/salmon.php');
|
||||||
function notifier_run(&$argv, &$argc){
|
function notifier_run(&$argv, &$argc){
|
||||||
global $a;
|
global $a;
|
||||||
|
|
||||||
require_once('include/datetime.php');
|
require_once 'include/datetime.php';
|
||||||
require_once('include/items.php');
|
require_once 'include/items.php';
|
||||||
require_once('include/bbcode.php');
|
require_once 'include/bbcode.php';
|
||||||
require_once('include/email.php');
|
require_once 'include/email.php';
|
||||||
|
|
||||||
if ($argc < 3) {
|
if ($argc < 3) {
|
||||||
return;
|
return;
|
||||||
|
@ -139,7 +139,7 @@ function notifier_run(&$argv, &$argc){
|
||||||
if (!$r) {
|
if (!$r) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
require_once('include/Contact.php');
|
require_once 'include/Contact.php';
|
||||||
foreach ($r as $contact) {
|
foreach ($r as $contact) {
|
||||||
terminate_friendship($user, $self, $contact);
|
terminate_friendship($user, $self, $contact);
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ function notifier_run(&$argv, &$argc){
|
||||||
|
|
||||||
$slap = ostatus::salmon($target_item,$owner);
|
$slap = ostatus::salmon($target_item,$owner);
|
||||||
|
|
||||||
require_once('include/group.php');
|
require_once 'include/group.php';
|
||||||
|
|
||||||
$parent = $items[0];
|
$parent = $items[0];
|
||||||
|
|
||||||
|
|
|
@ -5,21 +5,22 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
use Friendica\Network\Probe;
|
||||||
|
|
||||||
require_once("include/Contact.php");
|
require_once 'include/Contact.php';
|
||||||
require_once("include/threads.php");
|
require_once 'include/threads.php';
|
||||||
require_once("include/html2bbcode.php");
|
require_once 'include/html2bbcode.php';
|
||||||
require_once("include/bbcode.php");
|
require_once 'include/bbcode.php';
|
||||||
require_once("include/items.php");
|
require_once 'include/items.php';
|
||||||
require_once("mod/share.php");
|
require_once 'mod/share.php';
|
||||||
require_once("include/enotify.php");
|
require_once 'include/enotify.php';
|
||||||
require_once("include/socgraph.php");
|
require_once 'include/socgraph.php';
|
||||||
require_once("include/Photo.php");
|
require_once 'include/Photo.php';
|
||||||
require_once("include/Scrape.php");
|
require_once 'include/probe.php';
|
||||||
require_once("include/follow.php");
|
require_once 'include/follow.php';
|
||||||
require_once("include/api.php");
|
require_once 'include/api.php';
|
||||||
require_once("mod/proxy.php");
|
require_once 'mod/proxy.php';
|
||||||
require_once("include/xml.php");
|
require_once 'include/xml.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This class contain functions for the OStatus protocol
|
* @brief This class contain functions for the OStatus protocol
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
require_once('include/Probe.php');
|
|
||||||
|
|
||||||
/**
|
use Friendica\Network\Probe;
|
||||||
*
|
|
||||||
* Probe a network address to discover what kind of protocols we need to communicate with it.
|
|
||||||
*
|
|
||||||
* Warning: this function is a bit touchy and there are some subtle dependencies within the logic flow.
|
|
||||||
* Edit with care.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -18,16 +10,30 @@ require_once('include/Probe.php');
|
||||||
* of network.
|
* of network.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('PROBE_NORMAL', 0);
|
define('PROBE_NORMAL', 0);
|
||||||
define('PROBE_DIASPORA', 1);
|
define('PROBE_DIASPORA', 1);
|
||||||
|
|
||||||
function probe_url($url, $mode = PROBE_NORMAL, $level = 1) {
|
/**
|
||||||
|
* @brief Probes a network address to discover what kind of protocols we need to communicate with it.
|
||||||
|
*
|
||||||
|
* Warning: this function is a bit touchy and there are some subtle dependencies within the logic flow.
|
||||||
|
* Edit with care.
|
||||||
|
*
|
||||||
|
* @deprecated Use Friendica\Network\Probe instead
|
||||||
|
*
|
||||||
|
* @see Friendica\Network\Probe::uri()
|
||||||
|
*
|
||||||
|
* @param string $url Any URI
|
||||||
|
* @param int $mode One of the PROBE_* constants
|
||||||
|
* @return array Same data array returned by Friendica\Network\Probe::uri()
|
||||||
|
*/
|
||||||
|
function probe_url($url, $mode = PROBE_NORMAL) {
|
||||||
|
|
||||||
if ($mode == PROBE_DIASPORA)
|
if ($mode == PROBE_DIASPORA) {
|
||||||
$network = NETWORK_DIASPORA;
|
$network = NETWORK_DIASPORA;
|
||||||
else
|
} else {
|
||||||
$network = "";
|
$network = '';
|
||||||
|
}
|
||||||
|
|
||||||
$data = Probe::uri($url, $network);
|
$data = Probe::uri($url, $network);
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once('include/crypto.php');
|
use Friendica\Network\Probe;
|
||||||
require_once('include/Probe.php');
|
|
||||||
|
require_once 'include/crypto.php';
|
||||||
|
|
||||||
function get_salmon_key($uri, $keyhash) {
|
function get_salmon_key($uri, $keyhash) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
|
|
@ -9,13 +9,14 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
use Friendica\Network\Probe;
|
||||||
|
|
||||||
require_once('include/datetime.php');
|
require_once 'include/datetime.php';
|
||||||
require_once("include/Scrape.php");
|
require_once 'include/probe.php';
|
||||||
require_once("include/network.php");
|
require_once 'include/network.php';
|
||||||
require_once("include/html2bbcode.php");
|
require_once 'include/html2bbcode.php';
|
||||||
require_once("include/Contact.php");
|
require_once 'include/Contact.php';
|
||||||
require_once("include/Photo.php");
|
require_once 'include/Photo.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Fetch POCO data
|
* @brief Fetch POCO data
|
||||||
|
|
|
@ -5,7 +5,7 @@ use Friendica\Core\Config;
|
||||||
function update_gcontact_run(&$argv, &$argc) {
|
function update_gcontact_run(&$argv, &$argc) {
|
||||||
global $a;
|
global $a;
|
||||||
|
|
||||||
require_once 'include/Scrape.php';
|
require_once 'include/probe.php';
|
||||||
require_once 'include/socgraph.php';
|
require_once 'include/socgraph.php';
|
||||||
|
|
||||||
logger('update_gcontact: start');
|
logger('update_gcontact: start');
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
require_once 'include/probe.php';
|
||||||
|
|
||||||
function acctlink_init(App $a) {
|
function acctlink_init(App $a) {
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\Network\Probe;
|
||||||
|
|
||||||
require_once('include/Contact.php');
|
require_once 'include/Contact.php';
|
||||||
require_once('include/socgraph.php');
|
require_once 'include/socgraph.php';
|
||||||
require_once('include/contact_selectors.php');
|
require_once 'include/contact_selectors.php';
|
||||||
require_once('include/Scrape.php');
|
require_once 'include/probe.php';
|
||||||
require_once('mod/proxy.php');
|
require_once 'mod/proxy.php';
|
||||||
require_once('include/Photo.php');
|
require_once 'include/Photo.php';
|
||||||
|
|
||||||
function contacts_init(App $a) {
|
function contacts_init(App $a) {
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
|
@ -27,8 +28,8 @@ function contacts_init(App $a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('include/group.php');
|
require_once 'include/group.php';
|
||||||
require_once('include/contact_widgets.php');
|
require_once 'include/contact_widgets.php';
|
||||||
|
|
||||||
if ($_GET['nets'] == "all") {
|
if ($_GET['nets'] == "all") {
|
||||||
$_GET['nets'] = "";
|
$_GET['nets'] = "";
|
||||||
|
@ -498,7 +499,7 @@ function contacts_content(App $a) {
|
||||||
'$baseurl' => App::get_baseurl(true),
|
'$baseurl' => App::get_baseurl(true),
|
||||||
));
|
));
|
||||||
|
|
||||||
require_once('include/contact_selectors.php');
|
require_once 'include/contact_selectors.php';
|
||||||
|
|
||||||
$tpl = get_markup_template("contact_edit.tpl");
|
$tpl = get_markup_template("contact_edit.tpl");
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\Network\Probe;
|
||||||
|
|
||||||
require_once('include/enotify.php');
|
require_once 'include/enotify.php';
|
||||||
require_once('include/group.php');
|
require_once 'include/group.php';
|
||||||
require_once('include/Probe.php');
|
|
||||||
|
|
||||||
function dfrn_confirm_post(App $a, $handsfree = null) {
|
function dfrn_confirm_post(App $a, $handsfree = null) {
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) {
|
||||||
* worried about key leakage than anybody cracking it.
|
* worried about key leakage than anybody cracking it.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
require_once('include/crypto.php');
|
require_once 'include/crypto.php';
|
||||||
|
|
||||||
$res = new_keypair(4096);
|
$res = new_keypair(4096);
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once('include/Photo.php');
|
require_once 'include/Photo.php';
|
||||||
|
|
||||||
update_contact_avatar($contact['photo'],$uid,$contact_id);
|
update_contact_avatar($contact['photo'],$uid,$contact_id);
|
||||||
|
|
||||||
|
@ -435,7 +435,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) {
|
||||||
if ((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND)) {
|
if ((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND)) {
|
||||||
|
|
||||||
if (($contact) && ($contact['network'] === NETWORK_DIASPORA)) {
|
if (($contact) && ($contact['network'] === NETWORK_DIASPORA)) {
|
||||||
require_once('include/diaspora.php');
|
require_once 'include/diaspora.php';
|
||||||
$ret = Diaspora::send_share($user[0],$r[0]);
|
$ret = Diaspora::send_share($user[0],$r[0]);
|
||||||
logger('share returns: ' . $ret);
|
logger('share returns: ' . $ret);
|
||||||
}
|
}
|
||||||
|
@ -448,7 +448,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) {
|
||||||
|
|
||||||
if((dbm::is_result($r)) && ($r[0]['hide-friends'] == 0) && ($activity) && (! $hidden)) {
|
if((dbm::is_result($r)) && ($r[0]['hide-friends'] == 0) && ($activity) && (! $hidden)) {
|
||||||
|
|
||||||
require_once('include/items.php');
|
require_once 'include/items.php';
|
||||||
|
|
||||||
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
||||||
intval($uid)
|
intval($uid)
|
||||||
|
@ -672,7 +672,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) {
|
||||||
$photo = App::get_baseurl() . '/images/person-175.jpg';
|
$photo = App::get_baseurl() . '/images/person-175.jpg';
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once("include/Photo.php");
|
require_once 'include/Photo.php';
|
||||||
|
|
||||||
update_contact_avatar($photo,$local_uid,$dfrn_record);
|
update_contact_avatar($photo,$local_uid,$dfrn_record);
|
||||||
|
|
||||||
|
@ -752,7 +752,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) {
|
||||||
|
|
||||||
if((dbm::is_result($r)) && ($r[0]['hide-friends'] == 0)) {
|
if((dbm::is_result($r)) && ($r[0]['hide-friends'] == 0)) {
|
||||||
|
|
||||||
require_once('include/items.php');
|
require_once 'include/items.php';
|
||||||
|
|
||||||
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
||||||
intval($local_uid)
|
intval($local_uid)
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\Network\Probe;
|
||||||
|
|
||||||
require_once('include/enotify.php');
|
require_once 'include/enotify.php';
|
||||||
require_once('include/Scrape.php');
|
require_once 'include/probe.php';
|
||||||
require_once('include/Probe.php');
|
require_once 'include/group.php';
|
||||||
require_once('include/group.php');
|
|
||||||
|
|
||||||
function dfrn_request_init(App $a) {
|
function dfrn_request_init(App $a) {
|
||||||
|
|
||||||
|
@ -522,8 +522,6 @@ function dfrn_request_post(App $a) {
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
|
||||||
|
|
||||||
$parms = Probe::profile(($hcard) ? $hcard : $url);
|
$parms = Probe::profile(($hcard) ? $hcard : $url);
|
||||||
|
|
||||||
if (! count($parms)) {
|
if (! count($parms)) {
|
||||||
|
@ -767,7 +765,7 @@ function dfrn_request_content(App $a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if($auto_confirm) {
|
if($auto_confirm) {
|
||||||
require_once('mod/dfrn_confirm.php');
|
require_once 'mod/dfrn_confirm.php';
|
||||||
$handsfree = array(
|
$handsfree = array(
|
||||||
'uid' => $r[0]['uid'],
|
'uid' => $r[0]['uid'],
|
||||||
'node' => $r[0]['nickname'],
|
'node' => $r[0]['nickname'],
|
||||||
|
|
|
@ -2,11 +2,12 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
|
||||||
require_once('include/contact_widgets.php');
|
require_once 'include/contact_widgets.php';
|
||||||
require_once('include/socgraph.php');
|
require_once 'include/probe.php';
|
||||||
require_once('include/Contact.php');
|
require_once 'include/socgraph.php';
|
||||||
require_once('include/contact_selectors.php');
|
require_once 'include/Contact.php';
|
||||||
require_once('mod/contacts.php');
|
require_once 'include/contact_selectors.php';
|
||||||
|
require_once 'mod/contacts.php';
|
||||||
|
|
||||||
function dirfind_init(App $a) {
|
function dirfind_init(App $a) {
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
require_once 'include/probe.php';
|
||||||
require_once('include/follow.php');
|
require_once 'include/follow.php';
|
||||||
require_once('include/Contact.php');
|
require_once 'include/Contact.php';
|
||||||
require_once('include/contact_selectors.php');
|
require_once 'include/contact_selectors.php';
|
||||||
|
|
||||||
function follow_content(App $a) {
|
function follow_content(App $a) {
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ require_once 'include/files.php';
|
||||||
require_once 'include/threads.php';
|
require_once 'include/threads.php';
|
||||||
require_once 'include/text.php';
|
require_once 'include/text.php';
|
||||||
require_once 'include/items.php';
|
require_once 'include/items.php';
|
||||||
require_once 'include/Scrape.php';
|
require_once 'include/probe.php';
|
||||||
require_once 'include/diaspora.php';
|
require_once 'include/diaspora.php';
|
||||||
require_once 'include/Contact.php';
|
require_once 'include/Contact.php';
|
||||||
|
|
||||||
|
@ -144,7 +144,6 @@ function item_post(App $a) {
|
||||||
$parent_contact = get_contact_details_by_url($thrparent[0]["author-link"]);
|
$parent_contact = get_contact_details_by_url($thrparent[0]["author-link"]);
|
||||||
|
|
||||||
if (!isset($parent_contact["nick"])) {
|
if (!isset($parent_contact["nick"])) {
|
||||||
require_once 'include/Scrape.php';
|
|
||||||
$probed_contact = probe_url($thrparent[0]["author-link"]);
|
$probed_contact = probe_url($thrparent[0]["author-link"]);
|
||||||
if ($probed_contact["network"] != NETWORK_FEED) {
|
if ($probed_contact["network"] != NETWORK_FEED) {
|
||||||
$parent_contact = $probed_contact;
|
$parent_contact = $probed_contact;
|
||||||
|
@ -1106,7 +1105,6 @@ function item_content(App $a) {
|
||||||
* @return boolean true if replaced, false if not replaced
|
* @return boolean true if replaced, false if not replaced
|
||||||
*/
|
*/
|
||||||
function handle_tag(App $a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $network = "") {
|
function handle_tag(App $a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $network = "") {
|
||||||
require_once 'include/Scrape.php';
|
|
||||||
require_once 'include/socgraph.php';
|
require_once 'include/socgraph.php';
|
||||||
|
|
||||||
$replaced = false;
|
$replaced = false;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
require_once 'include/probe.php';
|
||||||
require_once('include/follow.php');
|
require_once 'include/follow.php';
|
||||||
|
|
||||||
function ostatus_subscribe_content(App $a) {
|
function ostatus_subscribe_content(App $a) {
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
use Friendica\Network\Probe;
|
||||||
|
|
||||||
require_once 'include/Photo.php';
|
require_once 'include/Photo.php';
|
||||||
require_once 'include/photos.php';
|
require_once 'include/photos.php';
|
||||||
|
@ -12,7 +13,6 @@ require_once 'include/security.php';
|
||||||
require_once 'include/redir.php';
|
require_once 'include/redir.php';
|
||||||
require_once 'include/tags.php';
|
require_once 'include/tags.php';
|
||||||
require_once 'include/threads.php';
|
require_once 'include/threads.php';
|
||||||
require_once 'include/Probe.php';
|
|
||||||
|
|
||||||
function photos_init(App $a) {
|
function photos_init(App $a) {
|
||||||
|
|
||||||
|
@ -982,9 +982,9 @@ function photos_content(App $a) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('include/bbcode.php');
|
require_once 'include/bbcode.php';
|
||||||
require_once('include/security.php');
|
require_once 'include/security.php';
|
||||||
require_once('include/conversation.php');
|
require_once 'include/conversation.php';
|
||||||
|
|
||||||
if (! x($a->data,'user')) {
|
if (! x($a->data,'user')) {
|
||||||
notice( t('No photos selected') . EOL );
|
notice( t('No photos selected') . EOL );
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
require_once 'include/probe.php';
|
||||||
|
|
||||||
function probe_content(App $a) {
|
function probe_content(App $a) {
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\Network\Probe;
|
||||||
|
|
||||||
require_once("include/Contact.php");
|
require_once 'include/Contact.php';
|
||||||
require_once('include/Probe.php');
|
|
||||||
|
|
||||||
function profiles_init(App $a) {
|
function profiles_init(App $a) {
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ function profiles_post(App $a) {
|
||||||
proc_run(PRIORITY_LOW, "include/directory.php", $url);
|
proc_run(PRIORITY_LOW, "include/directory.php", $url);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('include/profile_update.php');
|
require_once 'include/profile_update.php';
|
||||||
profile_change();
|
profile_change();
|
||||||
|
|
||||||
// Update the global contact for the user
|
// Update the global contact for the user
|
||||||
|
@ -529,7 +529,7 @@ function profile_activity($changed, $value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('include/items.php');
|
require_once 'include/items.php';
|
||||||
|
|
||||||
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
|
@ -623,7 +623,7 @@ function profiles_content(App $a) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('include/profile_selectors.php');
|
require_once 'include/profile_selectors.php';
|
||||||
|
|
||||||
|
|
||||||
$a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array(
|
$a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array(
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
require_once 'include/probe.php';
|
||||||
require_once('include/follow.php');
|
require_once 'include/follow.php';
|
||||||
|
|
||||||
function repair_ostatus_content(App $a) {
|
function repair_ostatus_content(App $a) {
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\Network\Probe;
|
||||||
require_once("include/Probe.php");
|
|
||||||
|
|
||||||
function webfinger_content(App $a) {
|
function webfinger_content(App $a) {
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Friendica\Network;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file include/Probe.php
|
* @file src/Network/Probe.php
|
||||||
* @brief Functions for probing URL
|
* @brief Functions for probing URL
|
||||||
*
|
*
|
||||||
*/
|
*/
|
1
vendor/composer/autoload_classmap.php
vendored
1
vendor/composer/autoload_classmap.php
vendored
|
@ -12,6 +12,7 @@ return array(
|
||||||
'Friendica\\App' => $baseDir . '/src/App.php',
|
'Friendica\\App' => $baseDir . '/src/App.php',
|
||||||
'Friendica\\Core\\Config' => $baseDir . '/src/Core/Config.php',
|
'Friendica\\Core\\Config' => $baseDir . '/src/Core/Config.php',
|
||||||
'Friendica\\Core\\PConfig' => $baseDir . '/src/Core/PConfig.php',
|
'Friendica\\Core\\PConfig' => $baseDir . '/src/Core/PConfig.php',
|
||||||
|
'Friendica\\Network\\Probe' => $baseDir . '/src/Network/Probe.php',
|
||||||
'Friendica\\ParseUrl' => $baseDir . '/src/ParseUrl.php',
|
'Friendica\\ParseUrl' => $baseDir . '/src/ParseUrl.php',
|
||||||
'HTMLPurifier' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.php',
|
'HTMLPurifier' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.php',
|
||||||
'HTMLPurifier_Arborize' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php',
|
'HTMLPurifier_Arborize' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php',
|
||||||
|
|
1
vendor/composer/autoload_static.php
vendored
1
vendor/composer/autoload_static.php
vendored
|
@ -56,6 +56,7 @@ class ComposerStaticInitFriendica
|
||||||
'Friendica\\App' => __DIR__ . '/../..' . '/src/App.php',
|
'Friendica\\App' => __DIR__ . '/../..' . '/src/App.php',
|
||||||
'Friendica\\Core\\Config' => __DIR__ . '/../..' . '/src/Core/Config.php',
|
'Friendica\\Core\\Config' => __DIR__ . '/../..' . '/src/Core/Config.php',
|
||||||
'Friendica\\Core\\PConfig' => __DIR__ . '/../..' . '/src/Core/PConfig.php',
|
'Friendica\\Core\\PConfig' => __DIR__ . '/../..' . '/src/Core/PConfig.php',
|
||||||
|
'Friendica\\Network\\Probe' => __DIR__ . '/../..' . '/src/Network/Probe.php',
|
||||||
'Friendica\\ParseUrl' => __DIR__ . '/../..' . '/src/ParseUrl.php',
|
'Friendica\\ParseUrl' => __DIR__ . '/../..' . '/src/ParseUrl.php',
|
||||||
'HTMLPurifier' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.php',
|
'HTMLPurifier' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.php',
|
||||||
'HTMLPurifier_Arborize' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php',
|
'HTMLPurifier_Arborize' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php',
|
||||||
|
|
Loading…
Reference in a new issue