diff --git a/src/InternalDoc.php b/src/InternalDoc.php index c88524fc5..71f9b5fcd 100644 --- a/src/InternalDoc.php +++ b/src/InternalDoc.php @@ -892,6 +892,13 @@ abstract class InternalDoc { return $this->wrapper->getAPI()->getSelf(); } + /** + * Returns the session name. + */ + public function getSessionName(): string + { + return $this->wrapper->getAPI()->getSessionName(); + } /** * Return current settings. */ diff --git a/src/MTProto.php b/src/MTProto.php index c03885e84..d9bab9063 100644 --- a/src/MTProto.php +++ b/src/MTProto.php @@ -667,6 +667,13 @@ final class MTProto implements TLCallback, LoggerGetter { return $this->wrapper; } + /** + * Returns the session name. + */ + public function getSessionName(): string + { + return $this->wrapper->getSession()->getSessionDirectoryPath(); + } /** * Sleep function. * diff --git a/src/polyfill.php b/src/polyfill.php index 084ae6ee3..e101e0e31 100644 --- a/src/polyfill.php +++ b/src/polyfill.php @@ -8,6 +8,11 @@ if (defined('MADELINE_POLYFILLED')) { define('MADELINE_POLYFILLED', true); +if (PHP_VERSION_ID === 80202) { + echo('PHP 8.2.2 has a critical garbage collector bug, please switch to PHP 8.1, PHP 8.2.1 or PHP 8.2.3 once it gets released'); + die(1); +} + use Amp\Http\Client\Cookie\InMemoryCookieJar; use Amp\Http\Client\Cookie\LocalCookieJar; use Amp\Socket\EncryptableSocket;