immusen

immusen

这家伙有点懒,还没写个性签名!

  • 财富值520
  • 威望值40
  • 总积分1080

个人信息

  • 2019-03-26 已签到
    连续签到2天,获得了10个金钱
  • 2019-03-25 已签到
    连续签到1天,获得了5个金钱
  • 2019-03-21 已签到
    连续签到2天,获得了10个金钱
  • 2019-03-20 已签到
    连续签到1天,获得了5个金钱
  • 2019-03-18 已签到
    连续签到1天,获得了5个金钱
  • 没用基础版版测试,但简单来说,你可以这么干,把配置文件都挪出来放到启动脚本websocket-server里:

    #!/usr/bin/env php
    <?php
    
    defined('YII_DEBUG') or define('YII_DEBUG', true);
    defined('YII_ENV') or define('YII_ENV', 'dev');
    defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
    defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));
    defined('STDERR') or define('STDERR', fopen('php://stderr', 'w'));
    
    require __DIR__ . '/vendor/autoload.php';
    require __DIR__ . '/vendor/yiisoft/yii2/Yii.php';
    
    //require __DIR__ . '/common/config/bootstrap.php';
    //require __DIR__ . '/websocket/config/bootstrap.php';
    //$config = yii\helpers\ArrayHelper::merge(
    //    require __DIR__ . '/common/config/main.php',
    //    require __DIR__ . '/common/config/main-local.php',
    //    require __DIR__ . '/websocket/config/main.php',
    //    require __DIR__ . '/websocket/config/main-local.php'
    //);
    
    Yii::setAlias('@immusen/websocket', __DIR__ . '/vendor/immusen/yii2-swoole-websocket');
    Yii::setAlias('@websocket', __DIR__ . '/websocket');
    $config = [
        'id' => 'websocket',
        'basePath' => __DIR__ . '/websocket',
        'bootstrap' => ['log'],
        'controllerNamespace' => 'websocket\controllers',
        'components' => [
            'errorHandler' => ['class' => 'yii\console\ErrorHandler'],
            'log' => [
                'targets' => [
                    [
                        'class' => 'yii\log\FileTarget',
                        'levels' => ['error', 'warning'],
                    ],
                ],
            ],
        ],
        'params' => [
            'listen' => 8721,
            'daemonize' => 0,
            'redis' => [
                'host' => '127.0.0.1',
                'port' => '6379',
    //        'auth' => 'passwd',
                'pool_size' => 10,
            ],
        ],
    ];
    
    $application = new immusen\websocket\Application($config);
    $exitCode = $application->run();
    exit($exitCode);
    
    
  • 2019-03-16 已签到
    连续签到1天,获得了5个金钱
  • 2019-03-14 已签到
    连续签到2天,获得了10个金钱
  • 2019-03-13 已签到
    连续签到1天,获得了5个金钱
  • 一个直接返回order_status的数值, 比如:50
    一个返回的结果$order_status是OrderModel的一个实例,那个数值50需要用$order_status->order_status来取

经理 等级规则
1080/2000
资料完整度
20/100
用户活跃度
0/100

Ta的关注

1

Ta的粉丝

6

Ta的访客

9