1 Star 0 Fork 1

小小程序员 / tp51

forked from rainbow / tp51 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
server.php 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
hzboye010 提交于 2018-03-19 17:03 . changes
#!/usr/bin/env php
<?php
// linux版
// require workerman gateway-worker
namespace think;
ini_set('display_errors', 'on');
// if(strpos(strtolower(PHP_OS), 'win') === 0)
// {
// exit("start.php not support windows.\n");
// }
// 检查扩展
// if(!extension_loaded('pcntl'))
// {
// exit("Please install pcntl extension. See http://doc3.workerman.net/appendices/install-extension.html\n");
// }
// if(!extension_loaded('posix'))
// {
// exit("Please install posix extension. See http://doc3.workerman.net/appendices/install-extension.html\n");
// }
// 定义应用目录
define('APP_PATH', __DIR__ . '/application/');
define('CONFIG_PATH', __DIR__ . '/config/');
define('POWER','rainbow');
define('__ROOT__', '');
// 加载基础文件
require __DIR__ . '/thinkphp/base.php';
// 执行应用并响应
Container::get('app',[APP_PATH])->bind('push/Run')->run()->send();
// gatewayClient
// gateClient是用来辅助 workerman或者是gateway进行用户分组以及向用户发送信息的组件,同时,能够快速便捷的将原有系统的uid和clientid绑定起来。
// github地址:https://github.com/walkor/GatewayClient
// ws = new WebSocket("ws://127.0.0.1:8282");
// ws.onopen = function() {
// console.log("连接成功");
// ws.send(JSON.stringify({uid:3,msg:'',type:'login'}));
// setInterval(function(){
// ws.send(JSON.stringify({uid:3,msg:'',type:'ping'}));
// },10000);
// };
// ws.onmessage = function(e) {
// console.log("收到服务端的消息:" + e.data);
// };
// a = {};a.uid=1,a.msg='test...',a.type='login';
// as = JSON.stringify(a);
// ws.send(as);
PHP
1
https://gitee.com/XiaoXiaoChengXuYuang/tp51.git
git@gitee.com:XiaoXiaoChengXuYuang/tp51.git
XiaoXiaoChengXuYuang
tp51
tp51
master

搜索帮助