diff --git a/cli/ratchet/data.php b/cli/ratchet/data.php index 01df364c..b462e911 100644 --- a/cli/ratchet/data.php +++ b/cli/ratchet/data.php @@ -2,7 +2,6 @@ namespace ChessServer\Cli\Ratchet; -use ChessServer\Db; use ChessServer\Command\Parser; use ChessServer\Command\Data\Cli; use ChessServer\Socket\Ratchet\ClientStorage; @@ -13,7 +12,6 @@ use Ratchet\Http\HttpServer; use Ratchet\Server\IoServer; use Ratchet\WebSocket\WsServer; -use React\EventLoop\Factory; use React\Socket\LimitingServer; use React\Socket\Server; use React\Socket\SecureServer; @@ -26,18 +24,10 @@ $pool = Pool::create(); -$db = new Db([ - 'driver' => $_ENV['DB_DRIVER'], - 'host' => $_ENV['DB_HOST'], - 'database' => $_ENV['DB_DATABASE'], - 'username' => $_ENV['DB_USERNAME'], - 'password' => $_ENV['DB_PASSWORD'], -]); - $logger = new Logger('log'); $logger->pushHandler(new StreamHandler(__DIR__.'/../../storage' . '/data.log', Logger::INFO)); -$parser = new Parser(new Cli($pool, $db)); +$parser = new Parser(new Cli($pool)); $clientStorage = new ClientStorage($logger); diff --git a/cli/workerman/data.php b/cli/workerman/data.php index b30ad4f8..7476601a 100644 --- a/cli/workerman/data.php +++ b/cli/workerman/data.php @@ -2,7 +2,6 @@ namespace ChessServer\Cli\Workerman; -use ChessServer\Db; use ChessServer\Command\Parser; use ChessServer\Command\Data\Cli; use ChessServer\Socket\Workerman\ClientStorage; @@ -19,18 +18,10 @@ $pool = Pool::create(); -$db = new Db([ - 'driver' => $_ENV['DB_DRIVER'], - 'host' => $_ENV['DB_HOST'], - 'database' => $_ENV['DB_DATABASE'], - 'username' => $_ENV['DB_USERNAME'], - 'password' => $_ENV['DB_PASSWORD'], -]); - $logger = new Logger('data'); $logger->pushHandler(new StreamHandler(DataWebSocket::STORAGE_FOLDER . '/data.log', Logger::INFO)); -$parser = new Parser(new Cli($pool, $db)); +$parser = new Parser(new Cli($pool)); $clientStorage = new ClientStorage($logger);