|
1 | 1 | #Dora RPC |
2 | | ----------- |
3 | | -[](https://travis-ci.org/xcl3721/Dora-RPC) |
| 2 | + |
| 3 | +[](https://travis-ci.org/xcl3721/Dora-RPC) [](https://packagist.org/packages/xcl3721/dora-rpc) [](https://packagist.org/packages/xcl3721/dora-rpc) [](https://packagist.org/packages/xcl3721/dora-rpc) |
4 | 4 | ##简介(Introduction) |
5 | 5 | 用于复杂项目前后端分离,分离后项目都通过API工作可更好维护管理。 |
6 | 6 | > * 是一款基础于Swoole定长包头通讯协议的最精简的RPC |
@@ -45,7 +45,7 @@ http://blog.sina.com.cn/s/blog_54ef39890102vs3h.html |
45 | 45 | > * zlib for compress packet |
46 | 46 |
|
47 | 47 | ##Installation |
48 | | -```shell |
| 48 | +``` |
49 | 49 | pecl install swoole |
50 | 50 |
|
51 | 51 | vim composer.json |
@@ -103,18 +103,7 @@ composer update |
103 | 103 |
|
104 | 104 | ###TCP客户端(TCP Client) |
105 | 105 | ```PHP |
106 | | -include "../src/Doraconst.php"; |
107 | | -include "../src/Packet.php"; |
108 | | -include "../src/Client.php"; |
109 | | - |
110 | | -/* |
111 | | -$config = array( |
112 | | - "group1" => array( |
113 | | - array("ip" => "127.0.0.1", "port" => 9567), |
114 | | - //array("ip"=>"127.0.0.1","port"=>9567), you can set more ,the client will random select one,to increase High availability |
115 | | - ), |
116 | | -);*/ |
117 | | -//or |
| 106 | + |
118 | 107 | $config = include("client.conf.php"); |
119 | 108 | //define the mode |
120 | 109 | $mode = array("type" => 1, "group" => "group1"); |
@@ -261,7 +250,6 @@ echo "max:" . $maxrequest . PHP_EOL; |
261 | 250 |
|
262 | 251 | ###服务端(Server) |
263 | 252 | ```PHP |
264 | | -include "src/Server.php"; |
265 | 253 |
|
266 | 254 | class Server extends DoraRPCServer { |
267 | 255 |
|
@@ -369,7 +357,7 @@ There is still a lot of optimization space |
369 | 357 |
|
370 | 358 | ---------- |
371 | 359 | ###Optimize performance性能优化 |
372 | | -```SHELL |
| 360 | +``` |
373 | 361 | vim demoserver.php |
374 | 362 | to see $externalConfig var |
375 | 363 | and swoole offcial document |
|
0 commit comments