use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\System;
-use Friendica\Database\dba;
+use Friendica\Database\DBA;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
use Friendica\Protocol\Email;
if (!is_object($xrd)) {
$ret = Network::curl($url, false, $redirects, ['timeout' => $xrd_timeout, 'accept_content' => 'application/xrd+xml']);
- if (!$ret["success"] && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
+ if (!empty($ret["errno"]) && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
logger("Probing timeout for ".$url, LOGGER_DEBUG);
return false;
}
$condition = ['nurl' => normalise_link($data["url"])];
- $old_fields = dba::selectFirst('gcontact', $fieldnames, $condition);
+ $old_fields = DBA::selectFirst('gcontact', $fieldnames, $condition);
// When the gcontact doesn't exist, the value "true" will trigger an insert.
// In difference to the public contacts we want to have every contact
$fields['created'] = DateTimeFormat::utcNow();
}
- dba::update('gcontact', $fields, $condition, $old_fields);
+ DBA::update('gcontact', $fields, $condition, $old_fields);
$fields = ['name' => $data['name'],
'nick' => $data['nick'],
// This won't trigger an insert. This is intended, since we only need
// public contacts for everyone we store items from.
// We don't need to store every contact on the planet.
- $old_fields = dba::selectFirst('contact', $fieldnames, $condition);
+ $old_fields = DBA::selectFirst('contact', $fieldnames, $condition);
$fields['name-date'] = DateTimeFormat::utcNow();
$fields['uri-date'] = DateTimeFormat::utcNow();
$fields['success_update'] = DateTimeFormat::utcNow();
- dba::update('contact', $fields, $condition, $old_fields);
+ DBA::update('contact', $fields, $condition, $old_fields);
}
}
$redirects = 0;
$ret = Network::curl($url, false, $redirects, ['timeout' => $xrd_timeout, 'accept_content' => $type]);
- if (!$ret["success"] && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
+ if (!empty($ret["errno"]) && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
return false;
}
$data = $ret['body'];
private static function pollNoscrape($noscrape_url, $data)
{
$ret = Network::curl($noscrape_url);
- if (!$ret["success"] && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
+ if (!empty($ret["errno"]) && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
return false;
}
$content = $ret['body'];
private static function pollHcard($hcard_url, $data, $dfrn = false)
{
$ret = Network::curl($hcard_url);
- if (!$ret["success"] && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
+ if (!empty($ret["errno"]) && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
return false;
}
$content = $ret['body'];
}
} elseif (normalise_link($pubkey) == 'http://') {
$ret = Network::curl($pubkey);
- if (!$ret["success"] && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
+ if (!empty($ret["errno"]) && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
return false;
}
$pubkey = $ret['body'];
// Fetch all additional data from the feed
$ret = Network::curl($data["poll"]);
- if (!$ret["success"] && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
+ if (!empty($ret["errno"]) && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
return false;
}
$feed = $ret['body'];
private static function feed($url, $probe = true)
{
$ret = Network::curl($url);
- if (!$ret["success"] && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
+ if (!empty($ret["errno"]) && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
return false;
}
$feed = $ret['body'];