antidot-fw / react-socket-server
Anti.Framework WAMP protocol based react socket server
1.x-dev
2019-07-27 14:25 UTC
Requires
- php: ^7.2.13
- antidot-fw/cli: 1.0.*
- cboden/ratchet: 0.4.*
- psr/container: 1.0.*
Requires (Dev)
- phpro/grumphp: ^0.15.0
- phpstan/phpstan: ^0.11.5
- phpunit/phpunit: ^8.0
- squizlabs/php_codesniffer: ^3.4
- symfony/var-dumper: ^4.2
This package is auto-updated.
Last update: 2024-11-30 02:27:33 UTC
README
Adapter that allows running a WAMP protocol socket server in Antidot Framework Applications.
Installation:
Using composer package manager
composer require antidot-fw/react-socket-server:dev-master
We have to add the config provider to the framework configuration to load the necessary dependencies, we make sure to load it after the provider of the framework itself.
<?php // config/config.php declare(strict_types=1); $aggregator = new ConfigAggregator([ // ... other config providers \Antidot\Container\Config\ConfigProvider::class, // Framework default config provider \Antidot\React\Socket\Container\Config\ConfigProvider::class, // React Application config provider new PhpFileProvider(realpath(__DIR__).'/services/{{,*.}prod,{,*.}local,{,*.}dev}.php'), new YamlConfigProvider(realpath(__DIR__).'/services/{{,*.}prod,{,*.}local,{,*.}dev}.yaml'), new ArrayProvider($cacheConfig), ], $cacheConfig['config_cache_path']); return $aggregator->getMergedConfig();
Running socket server
We just need to run a console command and we'll have the server up and running.
bin/console serve:socket:wamp