1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 07:34:41 +01:00
This commit is contained in:
Daniil Gentili 2021-04-25 16:50:19 +02:00
parent 19e518c9f9
commit d2d8b370e1
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
5 changed files with 8 additions and 5 deletions

View File

@ -82,7 +82,7 @@ class PostgresArray extends SqlArray
$host = $config->getHost();
$port = $config->getPort();
$this->pdo = new \PDO(
"pgsql:host={$host};port={$port};charset=UTF8",
"pgsql:host={$host};port={$port}",
$settings->getUsername(),
$settings->getPassword()
);

View File

@ -721,7 +721,8 @@ class MTProto extends AsyncConstruct implements TLCallback
// Report URI
'reportDest',
'calls'
'calls',
'snitch',
];
if (!$this->updateHandler instanceof Closure) {
$res[] = 'updateHandler';

View File

@ -224,7 +224,7 @@ class IncomingMessage extends Message
*
* @param T $return Return value
*
* @return ?Promise<T>
* @psalm-return ?Promise<T>
*/
public function getSideEffects($return): ?Promise
{

View File

@ -343,6 +343,7 @@ class Magic
}
if (self::$revision) {
self::$revision = \trim(self::$revision);
$latest = '';
try {
$version = (string) \min(80, (int) (PHP_MAJOR_VERSION.PHP_MINOR_VERSION));
if ($version === "56") {
@ -351,7 +352,7 @@ class Magic
$latest = @\file_get_contents("https://phar.madelineproto.xyz/release$version");
} catch (\Throwable $e) {
}
if ($latest ?? null) {
if ($latest) {
$latest = \trim(self::$revision) === \trim($latest) ? '' : ' (AN UPDATE IS REQUIRED)';
}
self::$revision = 'Revision: '.self::$revision.$latest;

View File

@ -26,6 +26,7 @@ use danog\MadelineProto\Ipc\IpcState;
use function Amp\File\exists;
use function Amp\File\open;
use function Amp\File\rename as renameAsync;
use function Amp\File\stat;
/**
@ -103,7 +104,7 @@ class SessionPaths
yield $file->write(\serialize($object));
yield $file->close();
yield \rename("$path.temp.php", $path);
yield renameAsync("$path.temp.php", $path);
} finally {
$unlock();
}