Further automated improvements

This commit is contained in:
Daniil Gentili 2020-10-01 21:06:37 +02:00
parent 297dca7f2c
commit 76c4fe480c
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
5 changed files with 7 additions and 4 deletions

View File

@ -45,6 +45,7 @@ trait Start
if ($this->getWebAPITemplate() === 'legacy') { if ($this->getWebAPITemplate() === 'legacy') {
$this->setWebAPITemplate($settings->getTemplates()->getHtmlTemplate()); $this->setWebAPITemplate($settings->getTemplates()->getHtmlTemplate());
} }
$app = null;
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
$stdout = getStdout(); $stdout = getStdout();
$prepare = Lang::$current_lang['apiChooseManualAuto'].PHP_EOL; $prepare = Lang::$current_lang['apiChooseManualAuto'].PHP_EOL;

View File

@ -113,6 +113,7 @@ class DoHConnector implements Connector
} }
$flags = \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT; $flags = \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT;
$timeout = $socketContext->getConnectTimeout(); $timeout = $socketContext->getConnectTimeout();
$e = null;
foreach ($uris as $builtUri) { foreach ($uris as $builtUri) {
try { try {
$streamContext = \stream_context_create($socketContext->withoutTlsContext()->toStreamContextArray()); $streamContext = \stream_context_create($socketContext->withoutTlsContext()->toStreamContextArray());

View File

@ -20,7 +20,7 @@ final class ProcessRunner extends RunnerAbstract
* *
* @return void * @return void
*/ */
public static function start(string $session, int $request): void public static function start(string $session, int $startupId): void
{ {
if (\PHP_SAPI === "cli") { if (\PHP_SAPI === "cli") {
$binary = \PHP_BINARY; $binary = \PHP_BINARY;
@ -48,7 +48,7 @@ final class ProcessRunner extends RunnerAbstract
$runner, $runner,
'madeline-ipc', 'madeline-ipc',
\escapeshellarg($session), \escapeshellarg($session),
$request $startupId
]); ]);
Logger::log("Starting process with $command"); Logger::log("Starting process with $command");

View File

@ -22,7 +22,7 @@ final class WebRunner extends RunnerAbstract
* *
* @return void * @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'])) { if (!isset($_SERVER['SERVER_NAME'])) {
return; return;
@ -75,7 +75,7 @@ final class WebRunner extends RunnerAbstract
} }
$params = [ $params = [
'argv' => ['madeline-ipc', $session, $id], 'argv' => ['madeline-ipc', $session, $startupId],
'cwd' => Magic::getcwd() 'cwd' => Magic::getcwd()
]; ];

View File

@ -35,6 +35,7 @@ trait Templates
private function webEcho(string $message = ''): \Generator private function webEcho(string $message = ''): \Generator
{ {
$auth = yield $this->getAuthorization(); $auth = yield $this->getAuthorization();
$form = null;
if ($auth === MTProto::NOT_LOGGED_IN) { if ($auth === MTProto::NOT_LOGGED_IN) {
if (isset($_POST['type'])) { if (isset($_POST['type'])) {
if ($_POST['type'] === 'phone') { if ($_POST['type'] === 'phone') {