Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问global $argv; $argv = [null,'start'];这两句是什么用处呢? #2

Open
iotio opened this issue Sep 16, 2016 · 4 comments
Open

Comments

@iotio
Copy link

iotio commented Sep 16, 2016

你好,为什么不加global $argv; $argv = [null,'start']; worker就无法启动呢?能否详细说一下。
还有一个问题就是,不需要require Autoloader.php吗?

@shellus
Copy link
Owner

shellus commented Sep 16, 2016

这是用php artisan wss:start启动的。
用的laravel框架的Console来运行的。所以并不用自己去管composer自动加载的问题。
至于你说的那什么参数,我不知道。

这个教程比较老了,等我看看再说。

@shellus
Copy link
Owner

shellus commented Sep 16, 2016

刚看了一下,现在的我完全可以将它们结合得更优雅。你可以稍等片刻,美味即将呈现

@shellus
Copy link
Owner

shellus commented Sep 16, 2016

ok了,请用v2.0分支,拉下来之后,composer install,socket代码写到app\Console\Commands\AppWorker.php

运行:在根目录php artisan ws start
php artisan stop
php artisan status

总之,看代码吧。和workerman一样,稍微整合了一下而已,只要就是处理了一下workerman的命令行输入问题。

workerman这个傻瓜,都是直接用$args全局变量来拿输入参数的。比较愁人。如果它抽象了的话,整合工作估计超简单。

@iotio
Copy link
Author

iotio commented Sep 17, 2016

大神解决速度杠杠的!写的很详细,我再研究一下!非常感谢。
若是可以再稍微完善一下文档,那就更完美了!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants