1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 19:24:42 +01:00

Fix issue with ORM

This commit is contained in:
Daniil Gentili 2024-04-08 15:34:04 +02:00
parent f54f2fc83e
commit b5535e62b6
6 changed files with 40 additions and 33 deletions

View File

@ -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)",

2
docs

@ -1 +1 @@
Subproject commit 821000468d14f943496b8bbc7183360c83630d6b
Subproject commit 11626857a0bfe4d094f4f43ad63b6df6364b6547

View File

@ -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.
*

View File

@ -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.
*/

View File

@ -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['_'],

View File

@ -355,6 +355,8 @@ trait Login
$this->fullGetSelf();
$this->getPhoneConfig();
$this->startUpdateSystem();
$this->initDb();
$this->serialize();
return $authorization;
}
/**