1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 20:35:23 +01:00
This commit is contained in:
qq80527769 2024-10-15 07:53:40 +03:30 committed by GitHub
commit 99842e0b77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -235,7 +235,8 @@ final class Magic
self::$isIpcWorker = \defined('MADELINE_WORKER_TYPE') ? MADELINE_WORKER_TYPE === 'madeline-ipc' : false;
// Important, obtain root relative to caller script
$backtrace = debug_backtrace(0);
self::$script_cwd = self::$cwd = \dirname(end($backtrace)['file']);
$lastTrace = end($backtrace);
self::$script_cwd = self::$cwd = isset($lastTrace['file']) ? \dirname($lastTrace['file']) : getcwd();
if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') {
try {
error_reporting(E_ALL);