diff --git a/composer.json b/composer.json index c36c241b3..bad67c512 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ }, "require": { "php-64bit": ">=8.2", - "danog/primemodule": "^1", + "danog/primemodule": "^1.0.13", "symfony/polyfill-mbstring": "*", "ext-mbstring": "*", "ext-json": "*", @@ -35,44 +35,44 @@ "ext-zlib": "*", "ext-fileinfo": "*", "amphp/amp": "^3", - "amphp/http-client": "^5", + "amphp/http-client": "^5.0.1", "amphp/websocket-client": "^2", - "amphp/http": "^2", - "amphp/socket": "^2", - "amphp/dns": "^2", - "amphp/byte-stream": "^2", - "amphp/file": "^3.0.1", + "amphp/http": "^2.1.1", + "amphp/socket": "^2.3", + "amphp/dns": "^2.1.1", + "amphp/byte-stream": "^2.1.1", + "amphp/file": "^3.0.2", "amphp/mysql": "^3", "amphp/postgres": "^2", "danog/dns-over-https": "^1", "amphp/http-client-cookies": "^2", "danog/tg-file-decoder": "^1", - "league/uri": "^7", + "league/uri": "^7.4.1", "danog/ipc": "^1", "amphp/log": "^2", - "danog/loop": "^1.1.0", - "phpseclib/phpseclib": "^3.0.22", + "danog/loop": "^1.1.1", + "phpseclib/phpseclib": "^3.0.37", "amphp/redis": "^2", - "psr/http-factory": "^1.0", + "psr/http-factory": "^1.0.2", "psr/log": "^3", "webmozart/assert": "^1.11", - "bacon/bacon-qr-code": "^2.0", - "nikic/php-parser": "^5", - "revolt/event-loop": "^1.0.5", - "danog/async-orm": "^1.0.1", + "bacon/bacon-qr-code": "^2.0.8", + "nikic/php-parser": "^5.0.2", + "revolt/event-loop": "^1.0.6", + "danog/async-orm": "^1.0.2", "symfony/thanks": "^1.3" }, "require-dev": { "ext-ctype": "*", - "danog/phpdoc": "^0.1.7", - "phpunit/phpunit": "^9", + "danog/phpdoc": "^0.1.24", + "phpunit/phpunit": "^9.6.19", "amphp/phpunit-util": "^3", "bamarni/composer-bin-plugin": "1.8.2", - "symfony/yaml": "^6.0", - "amphp/http-server": "^3", - "revolt/event-loop-adapter-react": "^1", + "symfony/yaml": "^6.4.3", + "amphp/http-server": "^3.3", + "revolt/event-loop-adapter-react": "^1.1.1", "dg/bypass-finals": "dev-master", - "brianium/paratest": "^6.11" + "brianium/paratest": "^6.11.1" }, "suggest": { "ext-primemodule": "Install the primemodule and FFI extensions to speed up MadelineProto (https://prime.madelineproto.xyz)", diff --git a/docs b/docs index 821000468..11626857a 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 821000468d14f943496b8bbc7183360c83630d6b +Subproject commit 11626857a0bfe4d094f4f43ad63b6df6364b6547 diff --git a/src/API.php b/src/API.php index b4fbbc34b..1efeb0eb5 100644 --- a/src/API.php +++ b/src/API.php @@ -52,7 +52,7 @@ final class API extends AbstractAPI * * @var string */ - public const RELEASE = '8.0.0-beta197'; + public const RELEASE = '8.0.0-beta198'; /** * We're not logged in. * diff --git a/src/MTProto.php b/src/MTProto.php index 522f69ad2..1eb69d3f1 100644 --- a/src/MTProto.php +++ b/src/MTProto.php @@ -896,15 +896,7 @@ final class MTProto implements TLCallback, LoggerGetter, SettingsGetter $this->minDatabase ??= new MinDatabase($this); $this->peerDatabase ??= new PeerDatabase($this); - $db = []; - $db []= async($this->referenceDatabase->init(...)); - $db []= async($this->minDatabase->init(...)); - $db []= async($this->peerDatabase->init(...)); - $db []= async($this->internalInitDbProperties(...), $this->getDbSettings(), $this->getDbPrefix().'_MTProto_'); - foreach ($this->secretChats as $chat) { - $db []= async($chat->init(...)); - } - await($db); + $this->initDb(); if (!isset($this->TL)) { $this->TL = new TL($this); @@ -924,6 +916,19 @@ final class MTProto implements TLCallback, LoggerGetter, SettingsGetter $this->seqUpdater ??= new SeqLoop($this); } + /** @internal */ + public function initDb(): void + { + $db = []; + $db []= async($this->referenceDatabase->init(...)); + $db []= async($this->minDatabase->init(...)); + $db []= async($this->peerDatabase->init(...)); + $db []= async($this->internalInitDbProperties(...), $this->getDbSettings(), $this->getDbPrefix().'_MTProto_'); + foreach ($this->secretChats as $chat) { + $db []= async($chat->init(...)); + } + await($db); + } /** * Upgrade MadelineProto instance. */ diff --git a/src/MTProtoTools/PeerDatabase.php b/src/MTProtoTools/PeerDatabase.php index ed7ee2c59..e976ef4be 100644 --- a/src/MTProtoTools/PeerDatabase.php +++ b/src/MTProtoTools/PeerDatabase.php @@ -497,7 +497,7 @@ final class PeerDatabase implements TLCallback ) { $existingChat = $this->db[$chat['id']]; if (!$existingChat || $existingChat != $chat) { - $this->API->logger("Updated chat -{$chat['id']}", Logger::ULTRA_VERBOSE); + $this->API->logger("Updated chat {$chat['id']}", Logger::ULTRA_VERBOSE); if (!$this->API->settings->getDb()->getEnablePeerInfoDb()) { $chat = [ '_' => $chat['_'], diff --git a/src/Wrappers/Login.php b/src/Wrappers/Login.php index 9008fd1db..b0c77c99d 100644 --- a/src/Wrappers/Login.php +++ b/src/Wrappers/Login.php @@ -355,6 +355,8 @@ trait Login $this->fullGetSelf(); $this->getPhoneConfig(); $this->startUpdateSystem(); + $this->initDb(); + $this->serialize(); return $authorization; } /**