From 71ba3bc564592dbad3d6bf87c997bf5458971c2a Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 17 Jul 2023 07:52:13 +0200 Subject: [PATCH] Fixup phar --- src/API.php | 2 +- tools/makephar.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/API.php b/src/API.php index 97da73d29..539013fa9 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-beta105'; + public const RELEASE = '8.0.0-beta106'; /** * Secret chat was not found. * diff --git a/tools/makephar.php b/tools/makephar.php index 580e27353..0e7174de7 100755 --- a/tools/makephar.php +++ b/tools/makephar.php @@ -46,7 +46,7 @@ if (defined("MADELINE_REAL_ROOT")) { @chdir(MADELINE_REAL_ROOT); } else { $backtrace = \debug_backtrace(0); - if (\count($backtrace) === 1) { + if (\count($backtrace) === 0) { if (isset($GLOBALS["argv"]) && !empty($GLOBALS["argv"])) { $arguments = \array_slice($GLOBALS["argv"], 1); } elseif (isset($_GET["argv"]) && !empty($_GET["argv"])) { @@ -60,7 +60,7 @@ if (defined("MADELINE_REAL_ROOT")) { } else { die("MadelineProto loader: you must include this file in another PHP script, see https://docs.madelineproto.xyz for more info.".PHP_EOL); } - \define("MADELINE_REAL_ROOT", \dirname($backtrace[0]["file"])); + \define("MADELINE_REAL_ROOT", \dirname(Phar::running(false))); @chdir(\MADELINE_REAL_ROOT); } }