From 807ba2765f2cf2f9a05117b588fe46feea979abf Mon Sep 17 00:00:00 2001 From: "rudolf.krupa" Date: Thu, 7 Apr 2022 13:13:38 +0200 Subject: [PATCH] Fix path for yii autoloader + change namespaces --- Broadcast.php | 14 ++++++------- EventManager.php | 2 +- Process.php | 4 ++-- README.md | 36 ++++++++++++++++----------------- SocketIoAsset.php | 4 ++-- commands/CommandTrait.php | 4 ++-- commands/SocketIoCommand.php | 8 ++++---- commands/WorkerCommand.php | 8 ++++---- composer.json | 6 +++--- drivers/RedisDriver.php | 4 ++-- events/EventInterface.php | 4 ++-- events/EventPolicyInterface.php | 2 +- events/EventPubInterface.php | 4 ++-- events/EventRoomInterface.php | 4 ++-- events/EventSubInterface.php | 4 ++-- server/.gitignore | 0 server/bundles/access-io.js | 0 server/bundles/args.js | 0 server/bundles/logger.js | 0 server/bundles/redis-io.js | 0 server/bundles/room-io.js | 0 server/bundles/server.js | 0 server/index.js | 0 server/package.json | 0 24 files changed, 53 insertions(+), 55 deletions(-) mode change 100644 => 100755 Broadcast.php mode change 100644 => 100755 EventManager.php mode change 100644 => 100755 SocketIoAsset.php mode change 100644 => 100755 commands/CommandTrait.php mode change 100644 => 100755 composer.json mode change 100644 => 100755 drivers/RedisDriver.php mode change 100644 => 100755 events/EventInterface.php mode change 100644 => 100755 events/EventPolicyInterface.php mode change 100644 => 100755 events/EventPubInterface.php mode change 100644 => 100755 events/EventRoomInterface.php mode change 100644 => 100755 events/EventSubInterface.php mode change 100644 => 100755 server/.gitignore mode change 100644 => 100755 server/bundles/access-io.js mode change 100644 => 100755 server/bundles/args.js mode change 100644 => 100755 server/bundles/logger.js mode change 100644 => 100755 server/bundles/redis-io.js mode change 100644 => 100755 server/bundles/room-io.js mode change 100644 => 100755 server/bundles/server.js mode change 100644 => 100755 server/index.js mode change 100644 => 100755 server/package.json diff --git a/Broadcast.php b/Broadcast.php old mode 100644 new mode 100755 index 62b3875..b1f1044 --- a/Broadcast.php +++ b/Broadcast.php @@ -1,6 +1,6 @@ [ 'socketio' => [ - 'class' => \yiicod\socketio\commands\SocketIoCommand::class, + 'class' => \hyperia\socketio\commands\SocketIoCommand::class, 'server' => 'localhost:1367' ], ] @@ -38,7 +36,7 @@ Config ```php 'controllerMap' => [ 'socketio' => [ - 'class' => \yiicod\socketio\commands\WorkerCommand::class, + 'class' => \hyperia\socketio\commands\WorkerCommand::class, 'server' => 'localhost:1367' ], ] @@ -92,7 +90,7 @@ pm2 start daemons-app.json ```php 'components' =>[ 'broadcastEvents' => [ - 'class' => \yiicod\socketio\EventManager::class, + 'class' => \hyperia\socketio\EventManager::class, 'nsp' => 'some_unique_key', // Namespaces with events folders 'namespaces' => [ @@ -100,7 +98,7 @@ pm2 start daemons-app.json ] ], 'broadcastDriver' => [ - 'class' => \yiicod\socketio\drivers\RedisDriver::class, + 'class' => \hyperia\socketio\drivers\RedisDriver::class, 'hostname' => 'localhost', 'port' => 6379, ], @@ -109,8 +107,8 @@ pm2 start daemons-app.json ##### Create publisher from server to client ```php - use yiicod\socketio\events\EventInterface; - use yiicod\socketio\events\EventPubInterface; + use hyperia\socketio\events\EventInterface; + use hyperia\socketio\events\EventPubInterface; class CountEvent implements EventInterface, EventPubInterface { @@ -149,14 +147,14 @@ pm2 start daemons-app.json ``` ```php //Run broadcast to client - \yiicod\socketio\Broadcast::emit(CountEvent::name(), ['count' => 10]) + \hyperia\socketio\Broadcast::emit(CountEvent::name(), ['count' => 10]) ``` ##### Create receiver from client to server ```php - use yiicod\socketio\events\EventInterface; - use yiicod\socketio\events\EventSubInterface; + use hyperia\socketio\events\EventInterface; + use hyperia\socketio\events\EventSubInterface; class MarkAsReadEvent implements EventInterface, EventSubInterface { @@ -202,9 +200,9 @@ You can have publisher and receiver in one event. If you need check data from cl ##### Receiver with checking from client to server ```php - use yiicod\socketio\events\EventSubInterface; - use yiicod\socketio\events\EventInterface; - use yiicod\socketio\events\EventPolicyInterface; + use hyperia\socketio\events\EventSubInterface; + use hyperia\socketio\events\EventInterface; + use hyperia\socketio\events\EventPolicyInterface; class MarkAsReadEvent implements EventInterface, EventSubInterface, EventPolicyInterface { @@ -247,9 +245,9 @@ You can have publisher and receiver in one event. If you need check data from cl Soket.io has room functionl. If you need it, you should implement: - EventRoomInterface ```php - use yiicod\socketio\events\EventPubInterface; - use yiicod\socketio\events\EventInterface; - use yiicod\socketio\events\EventRoomInterface; + use hyperia\socketio\events\EventPubInterface; + use hyperia\socketio\events\EventInterface; + use hyperia\socketio\events\EventRoomInterface; class CountEvent implements EventInterface, EventPubInterface, EventRoomInterface { @@ -310,6 +308,6 @@ Soket.io has room functionl. If you need it, you should implement: ``` ```php //Run broadcast to user id = 10 - \yiicod\socketio\Broadcast::emit(CountEvent::name(), ['count' => 10, 'userId' => 10]) + \hyperia\socketio\Broadcast::emit(CountEvent::name(), ['count' => 10, 'userId' => 10]) ``` \ No newline at end of file diff --git a/SocketIoAsset.php b/SocketIoAsset.php old mode 100644 new mode 100755 index b4fa329..dc0f38a --- a/SocketIoAsset.php +++ b/SocketIoAsset.php @@ -1,6 +1,6 @@