Skip to content

Commit

Permalink
Updated the data CLI commands
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Oct 4, 2024
1 parent 566a255 commit a2d24e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
12 changes: 1 addition & 11 deletions cli/ratchet/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);

Expand Down
11 changes: 1 addition & 10 deletions cli/workerman/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down

0 comments on commit a2d24e3

Please sign in to comment.