Move fetch_url

move fetch_url function
This commit is contained in:
Adam Magness 2018-01-26 23:09:48 -05:00
parent 1b51777825
commit c67452f72e
25 changed files with 55 additions and 35 deletions

View file

@ -8,6 +8,7 @@
namespace Friendica\Worker;
use Friendica\Core\Config;
use Friendica\Util\Network;
/**
* @brief check the git repository VERSION file and save the version to the DB
@ -37,7 +38,7 @@ class CheckVersion {
logger("Checking VERSION from: ".$checked_url, LOGGER_DEBUG);
// fetch the VERSION file
$gitversion = dbesc(trim(fetch_url($checked_url)));
$gitversion = dbesc(trim(Network::fetchURL($checked_url)));
logger("Upstream VERSION is: ".$gitversion, LOGGER_DEBUG);
Config::set('system', 'git_friendica_version', $gitversion);

View file

@ -10,6 +10,7 @@ use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Util\Network;
class Directory {
public static function execute($url = '') {
@ -32,7 +33,7 @@ class Directory {
logger('Updating directory: ' . $arr['url'], LOGGER_DEBUG);
if (strlen($arr['url'])) {
fetch_url($dir . '?url=' . bin2hex($arr['url']));
Network::fetchURL($dir . '?url=' . bin2hex($arr['url']));
}
return;

View file

@ -11,6 +11,7 @@ use Friendica\Database\DBM;
use Friendica\Model\GContact;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
use Friendica\Util\Network;
require_once 'include/datetime.php';
@ -217,7 +218,7 @@ class DiscoverPoCo {
}
}
$x = fetch_url(get_server()."/lsearch?p=1&n=500&search=".urlencode($search));
$x = Network::fetchURL(get_server()."/lsearch?p=1&n=500&search=".urlencode($search));
$j = json_decode($x);
if (count($j->results)) {