From 76c4fe480c4d676a98d0d36f57384ef2c6727728 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 1 Oct 2020 21:06:37 +0200 Subject: [PATCH] Further automated improvements --- src/danog/MadelineProto/ApiWrappers/Start.php | 1 + src/danog/MadelineProto/DoHConnector.php | 1 + src/danog/MadelineProto/Ipc/Runner/ProcessRunner.php | 4 ++-- src/danog/MadelineProto/Ipc/Runner/WebRunner.php | 4 ++-- src/danog/MadelineProto/Wrappers/Templates.php | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/danog/MadelineProto/ApiWrappers/Start.php b/src/danog/MadelineProto/ApiWrappers/Start.php index 8476cc9f..979317c5 100644 --- a/src/danog/MadelineProto/ApiWrappers/Start.php +++ b/src/danog/MadelineProto/ApiWrappers/Start.php @@ -45,6 +45,7 @@ trait Start if ($this->getWebAPITemplate() === 'legacy') { $this->setWebAPITemplate($settings->getTemplates()->getHtmlTemplate()); } + $app = null; if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { $stdout = getStdout(); $prepare = Lang::$current_lang['apiChooseManualAuto'].PHP_EOL; diff --git a/src/danog/MadelineProto/DoHConnector.php b/src/danog/MadelineProto/DoHConnector.php index 5a9baf48..97c20d43 100644 --- a/src/danog/MadelineProto/DoHConnector.php +++ b/src/danog/MadelineProto/DoHConnector.php @@ -113,6 +113,7 @@ class DoHConnector implements Connector } $flags = \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT; $timeout = $socketContext->getConnectTimeout(); + $e = null; foreach ($uris as $builtUri) { try { $streamContext = \stream_context_create($socketContext->withoutTlsContext()->toStreamContextArray()); diff --git a/src/danog/MadelineProto/Ipc/Runner/ProcessRunner.php b/src/danog/MadelineProto/Ipc/Runner/ProcessRunner.php index c5e93142..db746cf2 100644 --- a/src/danog/MadelineProto/Ipc/Runner/ProcessRunner.php +++ b/src/danog/MadelineProto/Ipc/Runner/ProcessRunner.php @@ -20,7 +20,7 @@ final class ProcessRunner extends RunnerAbstract * * @return void */ - public static function start(string $session, int $request): void + public static function start(string $session, int $startupId): void { if (\PHP_SAPI === "cli") { $binary = \PHP_BINARY; @@ -48,7 +48,7 @@ final class ProcessRunner extends RunnerAbstract $runner, 'madeline-ipc', \escapeshellarg($session), - $request + $startupId ]); Logger::log("Starting process with $command"); diff --git a/src/danog/MadelineProto/Ipc/Runner/WebRunner.php b/src/danog/MadelineProto/Ipc/Runner/WebRunner.php index 8a36c45b..107a5410 100644 --- a/src/danog/MadelineProto/Ipc/Runner/WebRunner.php +++ b/src/danog/MadelineProto/Ipc/Runner/WebRunner.php @@ -22,7 +22,7 @@ final class WebRunner extends RunnerAbstract * * @return void */ - public static function start(string $session, int $id): void + public static function start(string $session, int $startupId): void { if (!isset($_SERVER['SERVER_NAME'])) { return; @@ -75,7 +75,7 @@ final class WebRunner extends RunnerAbstract } $params = [ - 'argv' => ['madeline-ipc', $session, $id], + 'argv' => ['madeline-ipc', $session, $startupId], 'cwd' => Magic::getcwd() ]; diff --git a/src/danog/MadelineProto/Wrappers/Templates.php b/src/danog/MadelineProto/Wrappers/Templates.php index e567a15e..7fb6f0d3 100644 --- a/src/danog/MadelineProto/Wrappers/Templates.php +++ b/src/danog/MadelineProto/Wrappers/Templates.php @@ -35,6 +35,7 @@ trait Templates private function webEcho(string $message = ''): \Generator { $auth = yield $this->getAuthorization(); + $form = null; if ($auth === MTProto::NOT_LOGGED_IN) { if (isset($_POST['type'])) { if ($_POST['type'] === 'phone') {