From fbfc2a9faa59ba05aa4194f833ff73b3c34d4edd Mon Sep 17 00:00:00 2001 From: Github Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 19:32:28 +0100 Subject: [PATCH] Possible fix --- examples/secret_bot.php | 6 ------ src/danog/MadelineProto/PsrLogger.php | 1 - src/danog/MadelineProto/SessionPaths.php | 16 ++++++++-------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/examples/secret_bot.php b/examples/secret_bot.php index 0e3f04281..e744c3b35 100755 --- a/examples/secret_bot.php +++ b/examples/secret_bot.php @@ -21,7 +21,6 @@ use danog\MadelineProto\EventHandler; use danog\MadelineProto\Logger; use danog\MadelineProto\Settings; -use danog\MadelineProto\Settings\Database\Mysql; use function Amp\async; use function Amp\Future\await; @@ -125,9 +124,4 @@ class SecretHandler extends EventHandler $settings = new Settings; $settings->getLogger()->setLevel(Logger::ULTRA_VERBOSE); -$settings->setDb( - (new Mysql) - ->setUsername('root') -); - SecretHandler::startAndLoop('secret.madeline', $settings); diff --git a/src/danog/MadelineProto/PsrLogger.php b/src/danog/MadelineProto/PsrLogger.php index 13e906a0a..8950b7837 100644 --- a/src/danog/MadelineProto/PsrLogger.php +++ b/src/danog/MadelineProto/PsrLogger.php @@ -7,7 +7,6 @@ namespace danog\MadelineProto; use Psr\Log\AbstractLogger; use Psr\Log\InvalidArgumentException; use Psr\Log\LogLevel; -use Stringable; /** * PSR-3 wrapper for MadelineProto's Logger. diff --git a/src/danog/MadelineProto/SessionPaths.php b/src/danog/MadelineProto/SessionPaths.php index a83d11dee..96ffa8eec 100644 --- a/src/danog/MadelineProto/SessionPaths.php +++ b/src/danog/MadelineProto/SessionPaths.php @@ -87,12 +87,12 @@ final class SessionPaths { $session = Tools::absolute($session); $this->sessionDirectoryPath = $session; - $this->sessionPath = "$session/safe.php"; - $this->lightStatePath = "$session/lightState.php"; - $this->lockPath = "$session/lock"; - $this->ipcPath = "$session/ipc"; - $this->ipcCallbackPath = "$session/callback.ipc"; - $this->ipcStatePath = "$session/ipcState.php"; + $this->sessionPath = $session.DIRECTORY_SEPARATOR."safe.php"; + $this->lightStatePath = $session.DIRECTORY_SEPARATOR."lightState.php"; + $this->lockPath = $session.DIRECTORY_SEPARATOR."lock"; + $this->ipcPath = $session.DIRECTORY_SEPARATOR."ipc"; + $this->ipcCallbackPath = $session.DIRECTORY_SEPARATOR."callback.ipc"; + $this->ipcStatePath = $session.DIRECTORY_SEPARATOR."ipcState.php"; if (!exists($session)) { createDirectory($session); return; @@ -102,10 +102,10 @@ final class SessionPaths createDirectory($session); foreach (['safe.php', 'lightState.php', 'lock', 'ipc', 'callback.ipc', 'ipcState.php'] as $part) { if (exists("$session.$part")) { - move("$session.$part", "$session/$part"); + move("$session.$part", $session.DIRECTORY_SEPARATOR."$part"); } if (exists("$session.$part.lock")) { - move("$session.$part.lock", "$session/$part.lock"); + move("$session.$part.lock", $session.DIRECTORY_SEPARATOR."$part.lock"); } } }