mirror of
https://github.com/friendica/friendica
synced 2025-04-30 09:44:22 +02:00
Rename App Methods
- renamed a lot of App methods to CamelCase - replaced direct public variables with get-/set-Methods
This commit is contained in:
parent
5f9dd11cfb
commit
5a02e39a65
94 changed files with 481 additions and 338 deletions
|
@ -1220,7 +1220,7 @@ class DFRN
|
|||
|
||||
$xml = $ret['body'];
|
||||
|
||||
$curl_stat = $a->get_curl_code();
|
||||
$curl_stat = Network::getCurl()->getCode();
|
||||
if (empty($curl_stat)) {
|
||||
Contact::markForArchival($contact);
|
||||
return -3; // timed out
|
||||
|
@ -1372,13 +1372,13 @@ class DFRN
|
|||
|
||||
logger('dfrn_deliver: ' . "RECEIVED: " . $xml, LOGGER_DATA);
|
||||
|
||||
$curl_stat = $a->get_curl_code();
|
||||
$curl_stat = Network::getCurl()->getCode();
|
||||
if (empty($curl_stat) || empty($xml)) {
|
||||
Contact::markForArchival($contact);
|
||||
return -9; // timed out
|
||||
}
|
||||
|
||||
if (($curl_stat == 503) && stristr($a->get_curl_headers(), 'retry-after')) {
|
||||
if (($curl_stat == 503) && stristr(Network::getCurl()->getHeaders(), 'retry-after')) {
|
||||
Contact::markForArchival($contact);
|
||||
return -10;
|
||||
}
|
||||
|
@ -1469,14 +1469,14 @@ class DFRN
|
|||
|
||||
$xml = Network::post($dest_url, $envelope, ["Content-Type: ".$content_type]);
|
||||
|
||||
$curl_stat = $a->get_curl_code();
|
||||
$curl_stat = Network::getCurl()->getCode();
|
||||
if (empty($curl_stat) || empty($xml)) {
|
||||
logger('Empty answer from ' . $contact['id'] . ' - ' . $dest_url);
|
||||
Contact::markForArchival($contact);
|
||||
return -9; // timed out
|
||||
}
|
||||
|
||||
if (($curl_stat == 503) && (stristr($a->get_curl_headers(), 'retry-after'))) {
|
||||
if (($curl_stat == 503) && (stristr(Network::getCurl()->getHeaders(), 'retry-after'))) {
|
||||
Contact::markForArchival($contact);
|
||||
return -10;
|
||||
}
|
||||
|
@ -2496,7 +2496,7 @@ class DFRN
|
|||
|
||||
/// @todo Do we really need this check for HTML elements? (It was copied from the old function)
|
||||
if ((strpos($item['body'], '<') !== false) && (strpos($item['body'], '>') !== false)) {
|
||||
$base_url = get_app()->get_baseurl();
|
||||
$base_url = get_app()->getBaseURL();
|
||||
$item['body'] = reltoabs($item['body'], $base_url);
|
||||
|
||||
$item['body'] = html2bb_video($item['body']);
|
||||
|
|
|
@ -3080,7 +3080,7 @@ class Diaspora
|
|||
$content_type = (($public_batch) ? "application/magic-envelope+xml" : "application/json");
|
||||
|
||||
Network::post($dest_url."/", $envelope, ["Content-Type: ".$content_type]);
|
||||
$return_code = $a->get_curl_code();
|
||||
$return_code = Network::getCurl()->getCode();
|
||||
} else {
|
||||
logger("test_mode");
|
||||
return 200;
|
||||
|
@ -3089,7 +3089,7 @@ class Diaspora
|
|||
|
||||
logger("transmit: ".$logid."-".$guid." to ".$dest_url." returns: ".$return_code);
|
||||
|
||||
if (!$return_code || (($return_code == 503) && (stristr($a->get_curl_headers(), "retry-after")))) {
|
||||
if (!$return_code || (($return_code == 503) && (stristr(Network::getCurl()->getHeaders(), "retry-after")))) {
|
||||
if (!$no_queue && !empty($contact['contact-type']) && ($contact['contact-type'] != Contact::ACCOUNT_TYPE_RELAY)) {
|
||||
logger("queue message");
|
||||
// queue message for redelivery
|
||||
|
|
|
@ -430,7 +430,7 @@ class Feed {
|
|||
// Distributed items should have a well formatted URI.
|
||||
// Additionally we have to avoid conflicts with identical URI between imported feeds and these items.
|
||||
if ($notify) {
|
||||
$item['guid'] = Item::guidFromUri($orig_plink, $a->get_hostname());
|
||||
$item['guid'] = Item::guidFromUri($orig_plink, $a->getHostName());
|
||||
unset($item['uri']);
|
||||
unset($item['parent-uri']);
|
||||
|
||||
|
|
|
@ -1830,7 +1830,7 @@ class OStatus
|
|||
}
|
||||
|
||||
$item["uri"] = $item['parent-uri'] = $item['thr-parent']
|
||||
= 'tag:'.get_app()->get_hostname().
|
||||
= 'tag:'.get_app()->getHostName().
|
||||
','.date('Y-m-d').':'.$action.':'.$owner['uid'].
|
||||
':person:'.$connect_id.':'.$item['created'];
|
||||
|
||||
|
|
|
@ -90,9 +90,9 @@ class PortableContact
|
|||
|
||||
logger('load: returns ' . $s, LOGGER_DATA);
|
||||
|
||||
logger('load: return code: ' . $a->get_curl_code(), LOGGER_DEBUG);
|
||||
logger('load: return code: ' . Network::getCurl()->getCode(), LOGGER_DEBUG);
|
||||
|
||||
if (($a->get_curl_code() > 299) || (! $s)) {
|
||||
if ((Network::getCurl()->getCode() > 299) || (! $s)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ class Salmon
|
|||
]);
|
||||
|
||||
$a = get_app();
|
||||
$return_code = $a->get_curl_code();
|
||||
$return_code = Network::getCurl()->getCode();
|
||||
|
||||
// check for success, e.g. 2xx
|
||||
|
||||
|
@ -163,7 +163,7 @@ class Salmon
|
|||
'Content-type: application/magic-envelope+xml',
|
||||
'Content-length: ' . strlen($salmon)
|
||||
]);
|
||||
$return_code = $a->get_curl_code();
|
||||
$return_code = Network::getCurl()->getCode();
|
||||
}
|
||||
|
||||
if ($return_code > 299) {
|
||||
|
@ -185,7 +185,7 @@ class Salmon
|
|||
Network::post($url, $salmon, [
|
||||
'Content-type: application/magic-envelope+xml',
|
||||
'Content-length: ' . strlen($salmon)]);
|
||||
$return_code = $a->get_curl_code();
|
||||
$return_code = Network::getCurl()->getCode();
|
||||
}
|
||||
|
||||
logger('slapper for '.$url.' returned ' . $return_code);
|
||||
|
@ -194,7 +194,7 @@ class Salmon
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (($return_code == 503) && (stristr($a->get_curl_headers(), 'retry-after'))) {
|
||||
if (($return_code == 503) && (stristr(Network::getCurl()->getHeaders(), 'retry-after'))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue