swoft-cloud / swoft-doc Goto Github PK
View Code? Open in Web Editor NEW📖 Swoft Framework Document(swoft.io)
Home Page: https://swoft-cloud.github.io/swoft-doc/#/zh-CN/
📖 Swoft Framework Document(swoft.io)
Home Page: https://swoft-cloud.github.io/swoft-doc/#/zh-CN/
base目录重命名为core,swoft文档的应用结构一章中及时修改一下吧,swoft/swoft也修改一下
当表字段为下划线分割的字段(time_create)时候.
在使用value方法时.如果传入time_create.则会提示time_create字段不存在.因为value方法内部调用了first方法.而first方法返回的字段属性名称为驼峰法.
而如果传入timeCreate时候.在查询阶段就会报错.因为表字段为time_create而非timeCreate.
建议value方法返回的时候.将传入的下划线分割的字段改为通过类似getTimeCreate()的方法获取.或者使用->timeCreate属性获取.
Case 1:
docker run -d -p 80:80 --name swoft swoft/swoft
这样安装宿主机可以正常访问,本机localhost却无法访问
Case 2:
docker run -d -p 80:80 -v /e/www/swoft:/var/www/swoft --name swoft swoft/swoft
将本地项目和宿主关联上之后,宿主机无法访问,本地localhost也无法访问
使用rpc服务伴随http启动的问题
当依据 文档是上添加
'class'=>\Swoft\Rpc\Server\ServiceDispatcher::class
会出现访问http服务器被ServiceDispatcher拦截
会走到 /swoft/rpc-server/src/ServiceDispatcher.php的72行导致请求中断
不添加拦截器后http访问成功,rpc服务正常运行
有社区也可以相互交流啊
Hey, i just noticed that Data Generation page is not avaliable(http://en.swoft.org/docs/2.x/en/tool/devtool/migrations.html)
Where is the translation of the documentation in English? There is a translation on the site, but not in the repository.
{
"code": 0,
"error": "(Swoft\Db\Exception\DbException) Pool error is Create connection error(Dsn(mysql:dbname=test;host=127.0.0.1:13306) can not to connected!) file(/var/www/swoft/vendor/swoft/db/src/Connector/MySqlConnector.php) line (43) file=/var/www/swoft/vendor/swoft/connection-pool/src/AbstractPool.php line=250",
"file": "At /var/www/swoft/vendor/swoft/db/src/DB.php line 81",
"trace": "#0 /var/www/swoft/vendor/swoft/db/src/Query/Builder.php(3324): Swoft\Db\DB::connection('db.pool')
#1 /var/www/swoft/vendor/swoft/db/src/Query/Builder.php(2437): Swoft\Db\Query\Builder->getConnection()
#2 /var/www/swoft/app/Http/Controller/OrderController.php(35): Swoft\Db\Query\Builder->cursor()
#3 /var/www/swoft/vendor/swoft/stdlib/src/Helper/PhpHelper.php(54): App\Http\Controller\OrderController->buy()
#4 /var/www/swoft/vendor/swoft/http-server/src/Middleware/DefaultMiddleware.php(75): Swoft\Stdlib\Helper\PhpHelper::call(Array)
#5 /var/www/swoft/vendor/swoft/http-server/src/RequestHandler.php(73): Swoft\Http\Server\Middleware\DefaultMiddleware->process(Object(Swoft\Http\Message\Request), Object(Swoft\Http\Server\RequestHandler))
#6 /var/www/swoft/vendor/swoft/http-server/src/Middleware/ValidatorMiddleware.php(50): Swoft\Http\Server\RequestHandler->handle(Object(Swoft\Http\Message\Request))
#7 /var/www/swoft/vendor/swoft/http-server/src/RequestHandler.php(73): Swoft\Http\Server\Middleware\ValidatorMiddleware->process(Object(Swoft\Http\Message\Request), Object(Swoft\Http\Server\RequestHandler))
#8 /var/www/swoft/vendor/swoft/http-server/src/Middleware/UserMiddleware.php(54): Swoft\Http\Server\RequestHandler->handle(Object(Swoft\Http\Message\Request))
#9 /var/www/swoft/vendor/swoft/http-server/src/RequestHandler.php(73): Swoft\Http\Server\Middleware\UserMiddleware->process(Object(Swoft\Http\Message\Request), Object(Swoft\Http\Server\RequestHandler))
#10 /var/www/swoft/vendor/swoft/view/src/Middleware/ViewMiddleware.php(41): Swoft\Http\Server\RequestHandler->handle(Object(Swoft\Http\Message\Request))
#11 /var/www/swoft/vendor/swoft/http-server/src/RequestHandler.php(73): Swoft\View\Middleware\ViewMiddleware->process(Object(Swoft\Http\Message\Request), Object(Swoft\Http\Server\RequestHandler))
#12 /var/www/swoft/app/Http/Middleware/FavIconMiddleware.php(45): Swoft\Http\Server\RequestHandler->handle(Object(Swoft\Http\Message\Request))
#13 /var/www/swoft/vendor/swoft/http-server/src/RequestHandler.php(73): App\Http\Middleware\FavIconMiddleware->process(Object(Swoft\Http\Message\Request), Object(Swoft\Http\Server\RequestHandler))
#14 /var/www/swoft/vendor/swoft/http-server/src/HttpDispatcher.php(80): Swoft\Http\Server\RequestHandler->handle(Object(Swoft\Http\Message\Request))
#15 /var/www/swoft/vendor/swoft/http-server/src/Swoole/RequestListener.php(42): Swoft\Http\Server\HttpDispatcher->dispatch(Object(Swoft\Http\Message\Request), Object(Swoft\Http\Message\Response))
#16 {main}"
}
其中DB的配置如下:
'db'=> [
'class' => Database::class,
'dsn' => 'mysql:dbname=test;host=127.0.0.1:13306',
'username' => 'root',
'password' => '123456',
'prefix' => 'vc_',
'charset' => 'utf8',
],
while (!feof($fp)) {
$tmp = stream_socket_recvfrom($fp, 1024);
if (strpos($tmp, RPC_EOL)) {
#缺少赋值语句
$result .= $tmp;
#
break;
} else {
$result .= $tmp;
}
}
hgetall 返回的不是key=>value的形式,而是把所有的 key\value 都放到了数组里面
set\hmset\hset 时候,如果是整形的,设置完之后无法 hincrby 或者 incrby ,提示不是一个整形数字
例如如下代码:
$rd2 = new \Redis();
$rd2->connect("127.0.0.1",6379);
$rd2->select(6);
$rd2->hMset('myms3', array('name' => 'Joe', 'salary' => 2000));
$this->gameRedis->hMset('myms1', array('name' => 'Joe', 'salary' => 2000));
$this->gameRedis->hSet("myms1","d",4);
用原装的redis类执行后和内置的redis执行后,redis-cli 看到的是如图:
127.0.0.1:6379[6]> hgetall myms1
而 myms1 是无法用 hincrby myms1 salary 1 的命令的,会提示 salary 不是整形
hgetall的问题,处理的时候就是不用 hgetall ,改用 hmget 就没事儿,但是 hmset 的int型字段实在没办法了。紧急求助!!!!!难道要抛弃内置的redis,采用原装的\Redis,自己再链接?
{"msg":"Connection pool waiting queue is full, maxActive=8,maxWait=8,currentCount=9","file":"/var/www/swoft/vendor/swoft/framework/src/Pool/ConnectionPool.php","line":240,"code":0}
文档2.X希望能增加一下
1 :无 subscribe 、psubscribe 提示
2 :发布订阅使用的 phpredis 原生的 可能过几秒有会断开 socket 连接断开, 在需要在开启发布订阅前 加???
歧义,这是如果使用phpredis原生客户端时,还是发布订阅这部分本来就是使用原生客户端了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.