1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 00:34:40 +01:00
This commit is contained in:
qq80527769 2024-10-11 15:55:16 +00:00 committed by GitHub
commit 6cd385ddee
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);