mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Rename AutoUpdater -> UpdateChecker
This commit is contained in:
@ -39,7 +39,7 @@ class UpdateCheckTask extends AsyncTask{
|
||||
/** @var string */
|
||||
private $error = "Unknown error";
|
||||
|
||||
public function __construct(AutoUpdater $updater, string $endpoint, string $channel){
|
||||
public function __construct(UpdateChecker $updater, string $endpoint, string $channel){
|
||||
$this->storeLocal(self::TLS_KEY_UPDATER, $updater);
|
||||
$this->endpoint = $endpoint;
|
||||
$this->channel = $channel;
|
||||
@ -74,7 +74,7 @@ class UpdateCheckTask extends AsyncTask{
|
||||
}
|
||||
|
||||
public function onCompletion() : void{
|
||||
/** @var AutoUpdater $updater */
|
||||
/** @var UpdateChecker $updater */
|
||||
$updater = $this->fetchLocal(self::TLS_KEY_UPDATER);
|
||||
if($this->hasResult()){
|
||||
/** @var UpdateInfo $response */
|
||||
|
@ -34,7 +34,7 @@ use function strlen;
|
||||
use function strtolower;
|
||||
use function ucfirst;
|
||||
|
||||
class AutoUpdater{
|
||||
class UpdateChecker{
|
||||
|
||||
/** @var Server */
|
||||
protected $server;
|
||||
@ -50,7 +50,7 @@ class AutoUpdater{
|
||||
|
||||
public function __construct(Server $server, string $endpoint){
|
||||
$this->server = $server;
|
||||
$this->logger = new \PrefixedLogger($server->getLogger(), "Auto Updater");
|
||||
$this->logger = new \PrefixedLogger($server->getLogger(), "Update Checker");
|
||||
$this->endpoint = "http://$endpoint/api/";
|
||||
|
||||
if($server->getConfigGroup()->getPropertyBool("auto-updater.enabled", true)){
|
||||
@ -121,7 +121,7 @@ class AutoUpdater{
|
||||
* @param string[] $lines
|
||||
*/
|
||||
protected function printConsoleMessage(array $lines, string $logLevel = \LogLevel::INFO) : void{
|
||||
$title = $this->server->getName() . ' Auto Updater';
|
||||
$title = $this->server->getName() . ' Update Checker';
|
||||
$this->logger->log($logLevel, sprintf('----- %s -----', $title));
|
||||
foreach($lines as $line){
|
||||
$this->logger->log($logLevel, $line);
|
Reference in New Issue
Block a user