antidot-fw/react-socket-server

基于 Anti.Framework WAMP 协议的 React Socket 服务器

1.x-dev 2019-07-27 14:25 UTC

This package is auto-updated.

Last update: 2024-08-30 01:51:11 UTC


README

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status

一个适配器,允许在 WAMP 协议 socket 服务器 中运行 Antidot 框架应用程序

安装

使用 Composer 包管理器

composer require antidot-fw/react-socket-server:dev-master

我们必须将配置提供者添加到框架配置中,以便加载必要的依赖项,我们确保在加载框架本身的提供者之后加载它。

<?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();

运行 socket 服务器

我们只需要运行一个控制台命令,服务器就会启动并运行。

bin/console serve:socket:wamp