Giter Site home page Giter Site logo

Comments (2)

13823761206 avatar 13823761206 commented on May 10, 2024

好冷清。

from yii2-swoole.

13823761206 avatar 13823761206 commented on May 10, 2024

处理了,这样配置就ok了。
<?php $params = array_merge( require(__DIR__ . '/../../common/config/params.php'), require(__DIR__ . '/../../common/config/params-local.php'), require(__DIR__ . '/params.php'), require(__DIR__ . '/params-local.php') ); defined('SWOOLE_PROCESS') or define('SWOOLE_PROCESS', 1); defined('SWOOLE_TCP') or define('SWOOLE_TCP', 1); return [ 'id' => 'app-console', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'controllerNamespace' => 'console\controllers', 'components' => [ 'log' => [ 'targets' => [ [ 'class' => yii\log\FileTarget::className(), 'levels' => ['error', 'warning'], ], ], ], 'session' => [ 'class' => yii\web\Session::className() ] ], 'controllerMap'=>[ 'serve' => [ 'class' => yii\console\controllers\ServeController::className(), 'docroot' => '@frontend/web', ], 'swoole' => [ 'class' => feehi\console\SwooleController::className(), 'rootDir' => str_replace('console/config', '', __DIR__ ),//yii2项目根路径 'type' => 'advanced',//yii2项目类型,默认为advanced。此处还可以为basic 'app' => 'frontend',//app目录地址,如果type为basic,这里一般为空 'host' => '127.0.0.1',//监听地址 'port' => 9999,//监听端口 'web' => 'web',//默认为web。rootDir app web目的是拼接yii2的根目录,如果你的应用为basic,那么app为空即可。 'debug' => true,//默认开启debug,上线应置为false 'env' => 'dev',//默认为dev,上线应置为prod 'swooleConfig' => [//标准的swoole配置项都可以再此加入 'reactor_num' => 2, 'worker_num' => 4, 'daemonize' => false, 'log_file' => __DIR__ . '/../../frontend/runtime/logs/swoole.log', 'log_level' => 0, 'pid_file' => __DIR__ . '/../../frontend/runtime/server.pid', ], ], 'swoole-backend' => [ 'class' => feehi\console\SwooleController::className(), 'rootDir' => str_replace('console/config', '', __DIR__ ),//yii2项目根路径 'app' => 'backend', 'host' => '127.0.0.1', 'port' => 9998, 'web' => 'web',//默认为web。rootDir app web目的是拼接yii2的根目录,如果你的应用为basic,那么app为空即可。 'debug' => true,//默认开启debug,上线应置为false 'env' => 'dev',//默认为dev,上线应置为prod 'swooleConfig' => [ 'reactor_num' => 2, 'worker_num' => 4, 'daemonize' => false, 'log_file' => __DIR__ . '/../../backend/runtime/logs/swoole.log', 'log_level' => 0, 'pid_file' => __DIR__ . '/../../backend/runtime/server.pid', ], ] ], 'params' => $params, ];

from yii2-swoole.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.