1
0
Fork 0
mirror of synced 2024-07-03 05:31:38 +12:00

revert(realtime): make access modifiers public again

This commit is contained in:
Torsten Dittmann 2021-06-15 10:41:02 +02:00
parent d8bae25438
commit 82b3a56d26

View file

@ -24,11 +24,11 @@ use Utopia\Swoole\Request as SwooleRequest;
class Server class Server
{ {
private Registry $register; public Registry $register;
private SwooleServer $server; public SwooleServer $server;
private Table $stats; public Table $stats;
private array $subscriptions; public array $subscriptions;
private array $connections; public array $connections;
public function __construct(Registry &$register, $host = '0.0.0.0', $port = 80, $config = []) public function __construct(Registry &$register, $host = '0.0.0.0', $port = 80, $config = [])
{ {
@ -59,7 +59,7 @@ class Server
* @param SwooleServer $server * @param SwooleServer $server
* @return void * @return void
*/ */
private function onStart(SwooleServer $server): void public function onStart(SwooleServer $server): void
{ {
Console::success('Server started succefully'); Console::success('Server started succefully');
Console::info("Master pid {$server->master_pid}, manager pid {$server->manager_pid}"); Console::info("Master pid {$server->master_pid}, manager pid {$server->manager_pid}");
@ -108,7 +108,7 @@ class Server
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
private function onWorkerStart(SwooleServer $server, int $workerId): void public function onWorkerStart(SwooleServer $server, int $workerId): void
{ {
Console::success('Worker ' . $workerId . ' started succefully'); Console::success('Worker ' . $workerId . ' started succefully');
@ -165,7 +165,7 @@ class Server
* @throws Exception * @throws Exception
* @throws UtopiaException * @throws UtopiaException
*/ */
private function onOpen(SwooleServer $server, Request $request): void public function onOpen(SwooleServer $server, Request $request): void
{ {
$app = new App('UTC'); $app = new App('UTC');
$connection = $request->fd; $connection = $request->fd;
@ -291,7 +291,7 @@ class Server
* @param Frame $frame * @param Frame $frame
* @return void * @return void
*/ */
private function onMessage(SwooleServer $server, Frame $frame) public function onMessage(SwooleServer $server, Frame $frame)
{ {
$server->push($frame->fd, 'Sending messages is not allowed.'); $server->push($frame->fd, 'Sending messages is not allowed.');
$server->close($frame->fd); $server->close($frame->fd);
@ -304,7 +304,7 @@ class Server
* @param int $connection * @param int $connection
* @return void * @return void
*/ */
private function onClose(SwooleServer $server, int $connection) public function onClose(SwooleServer $server, int $connection)
{ {
if (array_key_exists($connection, $this->connections)) { if (array_key_exists($connection, $this->connections)) {
$this->stats->decr($this->connections[$connection]['projectId'], 'connectionsTotal'); $this->stats->decr($this->connections[$connection]['projectId'], 'connectionsTotal');
@ -332,7 +332,7 @@ class Server
* @param int $workerId * @param int $workerId
* @return void * @return void
*/ */
private function onRedisPublish(string $payload, SwooleServer &$server, int $workerId) public function onRedisPublish(string $payload, SwooleServer &$server, int $workerId)
{ {
$event = json_decode($payload, true); $event = json_decode($payload, true);
@ -369,7 +369,7 @@ class Server
* @param SwooleServer $server * @param SwooleServer $server
* @return void * @return void
*/ */
private function tickSendProjectUsage(SwooleServer &$server) public function tickSendProjectUsage(SwooleServer &$server)
{ {
if ( if (
array_key_exists('console', $this->subscriptions) array_key_exists('console', $this->subscriptions)