FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
framework/examples/app_server.php at 3.0 · colinkyo/framework · GitHub
colinkyo
framework
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
framework
/
examples
/
app_server.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
20 lines (19 loc) · 832 Bytes
Breadcrumbs
framework
/
examples
/
app_server.php
Copy path
File metadata and controls
20 lines (19 loc) · 832 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
define
(
'
DEBUG
'
,
'
on
'
);
define
(
'
WEBPATH
'
,
realpath
(
__DIR__
.
'
/../
'
));
require
dirname
(
__DIR__
) .
'
/libs/lib_config.php
'
;
//设置PID文件的存储路径
SPF
\
Network
\Server::
setPidFile
(
__DIR__
.
'
/app_server.pid
'
);
/**
* 显示Usage界面
* php app_server.php start|stop|reload
*/
SPF
\
Network
\Server::
start
(
function
()
{
$
server
=
SPF
\
Protocol
\WebServer::
create
(
__DIR__
.
'
/swoole.ini
'
);
$
server
->
setAppPath
(
WEBPATH
.
'
/apps/
'
);
//设置应用所在的目录
$
server
->
setDocumentRoot
(
WEBPATH
);
$
server
->
setLogger
(
new
SPF
\
Log
\
EchoLog
(
__DIR__
.
"
/webserver.log
"
));
//Logger
//$server->daemonize(); //作为守护进程
$
server
->
run
(
array
(
'
worker_num
'
=>
1
,
'
max_request
'
=>
5000
,
'
log_file
'
=>
'
/tmp/swoole.log
'
));
});
Back
|
FazBrowse Home
|
New Git URL