mirror of
https://github.com/friendica/friendica
synced 2025-05-08 12:24:11 +02:00
Move ACCEPT constants to own "enum" class
This commit is contained in:
parent
c700645385
commit
73c3b21665
35 changed files with 144 additions and 138 deletions
|
@ -22,11 +22,10 @@
|
|||
namespace Friendica\Worker;
|
||||
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\GServer;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClient;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
|
||||
|
||||
class UpdateServerDirectory
|
||||
{
|
||||
|
@ -46,7 +45,7 @@ class UpdateServerDirectory
|
|||
|
||||
private static function discoverPoCo(array $gserver)
|
||||
{
|
||||
$result = DI::httpClient()->fetch($gserver['poco'] . '?fields=urls', 0, HttpClient::ACCEPT_JSON);
|
||||
$result = DI::httpClient()->fetch($gserver['poco'] . '?fields=urls', 0, HttpClientAccept::JSON);
|
||||
if (empty($result)) {
|
||||
Logger::info('Empty result', ['url' => $gserver['url']]);
|
||||
return;
|
||||
|
@ -79,7 +78,7 @@ class UpdateServerDirectory
|
|||
|
||||
private static function discoverMastodonDirectory(array $gserver)
|
||||
{
|
||||
$result = DI::httpClient()->fetch($gserver['url'] . '/api/v1/directory?order=new&local=true&limit=200&offset=0', 0, HttpClient::ACCEPT_JSON);
|
||||
$result = DI::httpClient()->fetch($gserver['url'] . '/api/v1/directory?order=new&local=true&limit=200&offset=0', 0, HttpClientAccept::JSON);
|
||||
if (empty($result)) {
|
||||
Logger::info('Empty result', ['url' => $gserver['url']]);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue