Improve composer.json and serialization
This commit is contained in:
parent
28afd56d54
commit
da561de1a9
@ -12,7 +12,7 @@
|
|||||||
"php": ">=5.6.0",
|
"php": ">=5.6.0",
|
||||||
"danog/primemodule": "^1.0.3",
|
"danog/primemodule": "^1.0.3",
|
||||||
"danog/magicalserializer": "^1.0",
|
"danog/magicalserializer": "^1.0",
|
||||||
"phpseclib/phpseclib": "dev-master#27370df",
|
"phpseclib/phpseclib": "dev-master#27370df as 2.0.15",
|
||||||
"vlucas/phpdotenv": "^2.4",
|
"vlucas/phpdotenv": "^2.4",
|
||||||
"erusev/parsedown": "^1.6",
|
"erusev/parsedown": "^1.6",
|
||||||
"rollbar/rollbar": "dev-master",
|
"rollbar/rollbar": "dev-master",
|
||||||
|
@ -57,13 +57,6 @@ class Serialization
|
|||||||
if ($filename == '') {
|
if ($filename == '') {
|
||||||
throw new \danog\MadelineProto\Exception('Empty filename');
|
throw new \danog\MadelineProto\Exception('Empty filename');
|
||||||
}
|
}
|
||||||
if ($instance->API->asyncInitPromise) {
|
|
||||||
return $instance->call((static function () use ($filename, $instance, $force) {
|
|
||||||
yield $instance->API->asyncInitPromise;
|
|
||||||
$instance->API->asyncInitPromise = null;
|
|
||||||
return self::serialize($filename, $instance, $force);
|
|
||||||
})());
|
|
||||||
}
|
|
||||||
if (isset($instance->API->setdem) && $instance->API->setdem) {
|
if (isset($instance->API->setdem) && $instance->API->setdem) {
|
||||||
$instance->API->setdem = false;
|
$instance->API->setdem = false;
|
||||||
$instance->API->__construct($instance->API->settings);
|
$instance->API->__construct($instance->API->settings);
|
||||||
@ -71,6 +64,13 @@ class Serialization
|
|||||||
if ($instance->API === null && !$instance->getting_api_id) {
|
if ($instance->API === null && !$instance->getting_api_id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if ($instance->API && $instance->API->asyncInitPromise) {
|
||||||
|
return $instance->call((static function () use ($filename, $instance, $force) {
|
||||||
|
yield $instance->API->asyncInitPromise;
|
||||||
|
$instance->API->asyncInitPromise = null;
|
||||||
|
return self::serialize($filename, $instance, $force);
|
||||||
|
})());
|
||||||
|
}
|
||||||
$instance->serialized = time();
|
$instance->serialized = time();
|
||||||
$realpaths = self::realpaths($filename);
|
$realpaths = self::realpaths($filename);
|
||||||
if (!file_exists($realpaths['lockfile'])) {
|
if (!file_exists($realpaths['lockfile'])) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user