dev-master
9999999-dev http://framework.lszzy.com/lszzy php framework
Apache-2.0
The Requires
- php >=5.1.2
by wuyong
framework lszzy
Wallogit.com
2017 © Pedro Peláez
lszzy php framework
最新版本的代码已经彻底废弃非命名空间代码,升级框架之后,apps/controller/和apps/models中的代码需要按照命名空间的规范修改一次, (*1)
使用内置应用服务器,可节省每次请求代码来的额外消耗。连接池技术可以很好的帮助存储系统节省连接资源。, (*2)
在线体验地址:http://www.swoole.com/page/index/, (*3)
, (*4)
{
"require": {
"matyhtf/swoole_framework": "dev-master"
}
}
SwooleFramework应用服务器,需要安装swoole扩展。, (*5)
pecl install swoole
然后修改php.ini加入extension=swoole.so, (*6)
<?php
require __DIR__.'/libs/lib_config.php';
$AppSvr = new Swoole\Protocol\AppServer();
$AppSvr->loadSetting(__DIR__."/swoole.ini"); //加载配置文件
$AppSvr->setAppPath(__DIR__.'/apps/'); //设置应用所在的目录
$AppSvr->setLogger(new Swoole\Log\EchoLog(false)); //Logger
/**
*如果你没有安装swoole扩展,这里还可选择
* BlockTCP 阻塞的TCP,支持windows平台,需要将worker_num设为1
* SelectTCP 使用select做事件循环,支持windows平台,需要将worker_num设为1
* EventTCP 使用libevent,需要安装libevent扩展
*/
$server = new \Swoole\Network\Server('0.0.0.0', 8888);
$server->setProtocol($AppSvr);
$server->daemonize(); //作为守护进程
$server->run(array('worker_num' => 1, 'max_request' => 5000));
php server.php [2013-07-09 12:17:05] Swoole. running. on 0.0.0.0:8888
在浏览器中打开 http://127.0.0.1:8888/, (*7)
server {
listen 80;
server_name www.swoole.com;
root /data/wwwroot/www.swoole.com;
location / {
if (!-e $request_filename){
proxy_pass http://127.0.0.1:9501;
}
}
}
<VirtualHost *:80>
ServerName www.swoole.com
DocumentRoot /data/webroot/www.swoole.com
DirectoryIndex index.html index.php
<Directory "/data/webroot/www.swoole.com">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
# ProxyPass /admin !
# ProxyPass /index.html !
# ProxyPass /static !
# ProxyPass / http://127.0.0.1:9501/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://127.0.0.1:9501$1 [L,P]
</IfModule>
</VirtualHost>
压测数据, (*8)
lszzy php framework
Apache-2.0
framework lszzy