GithubHelp home page GithubHelp logo

demo's People

Contributors

a2235565 avatar anythink-wx avatar chinasor avatar dupengshenyang avatar encircles avatar evalor avatar feng409 avatar guanhui07 avatar hanwenbo avatar hekuntong avatar jinchaojian avatar junjunya1995 avatar kajweb avatar kiss291323003 avatar landercy avatar lienze741 avatar maikuolan avatar mistaker avatar nicholaschan1025 avatar qq690712575 avatar rongmic avatar runstp avatar sth4me avatar stitch-june avatar tioncico avatar tocurd avatar webphplove avatar windrunner414 avatar xuesilf avatar yaphats avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

demo's Issues

tp 数据库操作

function static frameInitialize()
{
// 获得数据库配置
$dbConf = Config::getInstance()->getConf('database');
// 全局初始化
Db::setConfig($dbConf);
}

为啥这样使用tp 数据库操作不会有协程问题?,没看见代码在哪处理了?

关于魔术方法的问题

为什么在demo中的UserBean不使用__get与__set魔术方法而是使用写死的get(set)+属性名这种方式,仅仅只是考虑效率的原因,还是将来会加入set/get的注解?

异步保存聊天信息

ChatMessage中使用了单例模式,由于swoole 是常驻进程,当ChatMessage实例化后,storage 属性会一直是同一个值,createStorage()这个方法就没有什么多大的意义了。在聊天室的demo 中,作者特别喜欢使用单例模式,个人觉得单例模式有优点也有缺点,不必用太多。。

启用心跳检测 不起作用

开启了心跳检测,但是close一直没有日志输出

        $subPort->set(
            [
                'open_eof_check' => true, //打开EOF检测
                'package_eof' => '##', //设置EOF
                'open_eof_split' => true,
                'heartbeat_idle_time' => 60,
                'heartbeat_check_interval' => 6,
            ]
        );

运行 3.x-chat 报错不知道哪里弄错了

报错信息
[FatalError][file:/var/www/html/chat-demo/demo/vendor/easyswoole/easyswoole/src/Core.php][line:273]Uncaught TypeError: Argument 2 passed to EasySwoole\EasySwoole\Core::EasySwoole\EasySwoole{closure}() must be an instance of Swoole\Server\Task, integer given in /var/www/html/chat-demo/demo/vendor/easyswoole/easyswoole/src/Core.php:273
Stack trace:
#0 [internal function]: EasySwoole\EasySwoole\Core->EasySwoole\EasySwoole{closure}(Object(Swoole\WebSocket\Server), 16, 5, Object(App\Task\BroadcastTask))
#1 /var/www/html/chat-demo/demo/vendor/easyswoole/easyswoole/src/ServerManager.php(109): Swoole\Server->start()
#2 /var/www/html/chat-demo/demo/vendor/easyswoole/easyswoole/src/Core.php(136): EasySwoole\EasySwoole\ServerManager->start()
#3 /var/www/html/chat-demo/demo/vendor/easyswoole/easyswoole/src/Command/DefaultCommand/Start.php(98): EasySwoole\EasySwoole\Core->start()
#4 /var/www/html/chat-demo/demo/vendor/easyswoole/easyswoole/src/Command/CommandContainer.php(44): EasySwoole\EasySwoole\Command\DefaultCommand\Start->exec(Array)
#5 /var/www/html/chat-demo/demo/vendor/easyswoole/easyswoole/src/Command/Comma

启动时有个报错

当SERVER_TYPE设为EASYSWOOLE_WEB_SOCKET_SERVER就会报这个错,有没有解决方法
image

3.x-excel-Demo建议

demo使用的这个phpoffice/phpexcel库,已经停止维护了,迁移到新的项目了,建议换成新的项目composer包.

Fatal error: Namespace

Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in /www/wwwroot/bgx/demo/vendor/bin/easyswoole on line 13

热重载,修改文件后,报错Swoole\Coroutine\Channel::push(): must be called in the coroutine.

使用热重载,修改文件后,报错
PHP Fatal error: Swoole\Coroutine\Channel::push(): must be called in the coroutine. in /var/html/demo/vendor/easyswoole/http/src/Dispatcher.php on line 238

Fatal error: Swoole\Coroutine\Channel::push(): must be called in the coroutine. in /var/html/demo/vendor/easyswoole/http/src/Dispatcher.php on line 238
Error at file[/var/html/demo/vendor/easyswoole/http/src/Dispatcher.php] line[238] message:[Swoole\Coroutine\Channel::push(): must be called in the coroutine.]
PHP Fatal error: Swoole\Coroutine\Channel::push(): must be called in the coroutine. in /var/html/demo/vendor/easyswoole/http/src/Dispatcher.php on line 238

Fatal error: Swoole\Coroutine\Channel::push(): must be called in the coroutine. in /var/html/demo/vendor/easyswoole/http/src/Dispatcher.php on line 238
Error at file[/var/html/demo/vendor/easyswoole/http/src/Dispatcher.php] line[238] message:[Swoole\Coroutine\Channel::push(): must be called in the coroutine.]

test

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.