2019-12-20 21:46:30 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2019-12-21 18:11:51 +00:00
|
|
|
* @file src/Worker/UpdateGServer.php
|
2019-12-20 21:46:30 +00:00
|
|
|
*/
|
|
|
|
namespace Friendica\Worker;
|
|
|
|
|
|
|
|
use Friendica\Core\Logger;
|
|
|
|
use Friendica\Model\GServer;
|
|
|
|
use Friendica\Util\Strings;
|
|
|
|
|
2019-12-21 18:11:51 +00:00
|
|
|
class UpdateGServer
|
2019-12-20 21:46:30 +00:00
|
|
|
{
|
|
|
|
// Searches for the poco server list.
|
|
|
|
public static function execute($server_url)
|
|
|
|
{
|
|
|
|
if (empty($server_url)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$server_url = filter_var($server_url, FILTER_SANITIZE_URL);
|
|
|
|
if (substr(Strings::normaliseLink($server_url), 0, 7) != 'http://') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$ret = GServer::check($server_url);
|
2019-12-21 18:11:51 +00:00
|
|
|
Logger::info('Updated gserver', ['url' => $server_url, 'result' => $ret]);
|
2019-12-20 21:46:30 +00:00
|
|
|
}
|
|
|
|
}
|