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"); } } }