forked from easy-swoole/doc-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
en.html
executable file
·209 lines (199 loc) · 8.6 KB
/
en.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>easySwoole|swoole framework|swoole task|swoole project</title>
<meta name="keywords" content="eeasySwoole|swoole framework|swoole task|swoole project"/>
<meta name="description" content="easySwoole|swoole framework|swoole task|swoole project"/>
<link href="https://cdn.bootcss.com/bulma/0.7.1/css/bulma.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://cdn.staticfile.org/highlight.js/9.10.0/styles/vs.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/animate.css/3.5.2/animate.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<div class="main">
<nav class="navbar">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item" href="/">
<img src="img/easyswoole.png" alt="EASYSWOOLE">
</a>
<div class="navbar-burger burger" data-target="navbar">
<span></span>
<span></span>
<span></span>
</div>
</div>
<div id="navbar" class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item" href="/Manual/3.x/En/_book/">Doc</a>
<a class="navbar-item" href="https://github.com/easy-swoole/demo" target="_blank">Demo</a>
<a class="navbar-item" href="https://github.com/easy-swoole/easyswoole" target="_blank">Git</a>
</div>
</div>
</div>
</nav>
<section class="hero has-text-centered">
<div class="hero-body" style="padding-bottom: 0; padding-top: 1.5rem">
<div class="container">
<h3 class="hero-headline animated fadeInUp">An Happy Way To Use Swoole</h3>
<div class="hero-btn"><a class="btn-blue" id="start" href="/Manual/3.x/En/_book/Introduction/install.html">Getting Start</a></div>
</div>
<!-- 动画 -->
<embed class="image esanimation" src="img/easy.svg" type="image/svg+xml" pluginspage="img/easy.svg"/>
</div>
</section>
<!-- 框架特性说明 -->
<section class="section" style="padding-top: 1.5rem">
<div class="container">
<div class="introduction has-text-centered">
<h1 class="title">What is Easyswoole</h1>
<h2 class="subtitle">
EasySwoole is a distributed, persistent memory PHP framework based on the Swoole extension. It was created specifically for APIs to get rid of the performance penalties associated with process calls and file loading. EasySwoole highly encapsulates the Swoole Server and still maintains the original features of the Swoole server, supports simultaneous monitoring of HTTP, custom TCP, and UDP protocols, allowing developers to write multi-process, asynchronous, and highly available applications with minimal learning cost and effort.
</h2>
</div>
<div class="icons has-text-centered features">
<div class="columns">
<div class="column">
<i class="fa fa-fw fa-2x fa-cubes"></i>
<div class="icons-desc">High Performance</div>
</div>
<div class="column">
<i class="fa fa-fw fa-2x fa-cubes"></i>
<div class="icons-desc">Async</div>
</div>
<div class="column">
<i class="fa fa-fw fa-2x fa-cubes"></i>
<div class="icons-desc">Coroutine</div>
</div>
<div class="column">
<i class="fa fa-fw fa-2x fa-cubes"></i>
<div class="icons-desc">Mixed Protocols</div>
</div>
</div>
</div>
</div>
</section>
<!-- 动态代码块区域 -->
<section class="section" style="padding-top: 0;">
<div class="container">
<div class="columns is-desktop code-block">
<div class="column">
<div class="code-box">
<div class="code-area" id="codebox-1"></div>
</div>
</div>
<div class="column code-introduction">
<h2>HTTP Controller</h2>
<div class="code-introduction-desc">You can use it easily just like what you use in fpm framework</div>
</div>
</div>
<div class="columns is-desktop code-block">
<div class="column">
<div class="code-box">
<div class="code-area" id="codebox-2"></div>
</div>
</div>
<div class="column code-introduction">
<h2>Async Task</h2>
<div class="code-introduction-desc">You do not need to care about how to achieve an async process but just use it to exec your async task </div>
</div>
</div>
<div class="columns is-desktop code-block">
<div class="column">
<div class="code-box">
<div class="code-area" id="codebox-4"></div>
</div>
</div>
<div class="column code-introduction">
<h2>Pool</h2>
<div class="code-introduction-desc">Coroutine pool support,speed up your app</div>
</div>
</div>
</div>
</section>
<!-- 全局页脚 -->
<footer class="footer" style="padding-bottom: 1rem;padding-top: 1rem">
<div class="container">
<div class="content has-text-centered">
<p>
<strong>Easyswoole</strong> is power by <strong>yifeng.zhang</strong>
</p>
</div>
</div>
</footer>
<!-- 页面脚本资源 -->
<script src="https://cdn.bootcss.com/typed.js/2.0.6/typed.min.js"></script>
<script src="https://cdn.staticfile.org/highlight.js/9.10.0/highlight.min.js"></script>
<script src="https://cdn.staticfile.org/highlight.js/9.10.0/languages/php.min.js"></script>
<script src="css/index.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<!-- 动态代码块模板 -->
<pre id="code-template-1" style="display: none">
class Index extends Controller
{
function index()
{
$params = $this->request()->getRequestParams();
var_dump($params);
$this->response()->write('hello world');
}
}
</pre>
<pre id="code-template-2" style="display: none">
use EasySwoole\Core\Swoole\Task\TaskManager;
$phone = 'xxx';
TaskManager::async(function ()use($phone){
//do my task
$status = sendSms($phone);
saveToRedis($phone,$staus);
});
$this->response()->write('success');
</pre>
<pre id="code-template-4" style="display: none">
$pool = PoolManager::getInstance()->getPool(MysqlPool::class);
\go(function ()use($pool){
$db = $pool->getObj();
if($db){
$ret = $db->rawQuery('select sleep(1)');
$pool->freeObj($db);
var_dump('1 finish at '.time());
}else{
var_dump('db not available');
}
});
</pre>
<script>
window.onload = function () {
TypedCode('#codebox-1', 'code-template-1');
TypedCode('#codebox-2', 'code-template-2');
TypedCode('#codebox-4', 'code-template-4');
};
function addAnim(selector, anim) {
$(selector).hover(function () {
$(this).addClass(anim);
}, function () {
$(this).removeClass(anim);
}).on('touchstart', function () {
$(this).addClass(anim);
}).on('touchend', function () {
$(this).removeClass(anim);
});
}
addAnim('#start', 'animated pulse infinite');
</script>
<script>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?4c8d895ff3b25bddb6fa4185c8651cc3";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</div>
</body>
</html>