Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions README-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[English](./README.md) | 中文

# dubbo-php-framework

dubbo-php-framework 使用Swoole实现的RPC通信框架,它与Dubbo协议完全兼容,并且可以同时作为消费者和提供者,使用Zookeeper用作服务注册发现,支持fastjson,hessian2等数据序列化方式。<br /><br />
当前框架是对apache/dubbo-php-framework的重写。

![arch](https://github.com/crazyxman/dubbo-php-framework/blob/master/Arch.png)

# 介绍
- provider在多进程中运行、工作进程用于处理特定的业务,管理进程控制工作进程的生命周期,主进程处理网络IO。
- agent监视注册中心中提供者地址信息的更改,并将其同步到本地内存,以供consumer使用。
- consumer与agent配合使用,通过TCP或UnixSocket从agent中获取提供者地址。

# 变更项
- 重写了全部代码,拥有更好的可读性(有利于更多的人参与进来)。
- 引入composer进行管理加载,利于安装及作为其他框架的一个组件使用。
- 原有的agent模块由 c代码+redis 改为 纯php实现, 减少组件依赖,利于使用。
- provider,consumer,agent等配置文件互相独立,存放位置自定义。
- provider,consumer都支持了hessian2数据序列化。
- 配置文件格式由ini改为yaml,减少冗余字段,可读性更高。
- 去除log4php日志组件, 对外提供日志组件实现接口,用户可进行自定义实现。
- provider模块引入注解可将现有代码基本无需修改即可注册为dubbo服务, 无侵入。
- swoole_server配置及回调函数用户可自定义,利于使用者根据当前应用场景优化服务。
- 消费同ip:port提供者时,保持了TCP连接。
- 返回的hessian序列化数据解析后由复杂的对象转为了数组。
- monitor 收集的数据更加完整。

Wiki: [中文](https://github.com/crazyxman/dubbo-php-framework/wiki/%E4%B8%AD%E6%96%87)
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
## <font size=6>php framework for apache dubbo</font>
English | [中文](./README-CN.md)

# dubbo-php-framework

<font size=3 face="Segoe UI">dubbo-php-framework is a RPC communication framework for PHP language. It is fully compatible with Dubbo protocol, and can be used as provider terminal and consumer terminal simultaneously. Using zookeeper for service registration discovery, and using fastjson and hessian for Serialization.</font>

![image](https://github.com/apache/dubbo-php-framework/blob/master/arch.png)

## <font size=5>Introduction</font>
- <font size=3 face="Segoe UI">php provider runs in multiple processes. The worker process is used to process specific business, the manager process controls the lifecycle of the worker process, and the master process processes the network IO.</font>
- <font size=3 face="Segoe UI">Agent monitors the change of provider address information in registry and synchronizes them to local redis for all php consumers on the machine to share.</font>
- <font size=3 face="Segoe UI">php consumer、redis and agent are deployed on all consumer machines and communicate with each other on unix socket.</font>
- <font size=3 face="Segoe UI">provider_admin is deployed on all provider machines to control the lifecycle of all php providers on that machine.</font>
# Introduction
- php provider runs in multiple processes. The worker process is used to process specific business, the manager process controls the lifecycle of the worker process, and the master process processes the network IO.
- Agent monitors the change of provider address information in registry and synchronizes them to local memory for all php consumers on the machine to share
- consumer、 agent are deployed on all consumer machines and communicate with each other on unix socket or TCP socket
provider is deployed on all provider machines to control the lifecycle of all php providers on that machine

<a href="https://github.com/dubbo/php-framework-for-apache-dubbo/wiki/%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B">Quick start (Chinese)</a>
<a href="https://github.com/dubbo/php-framework-for-apache-dubbo/wiki/%E5%AE%89%E8%A3%85%E5%90%91%E5%AF%BC">Installation guide (Chinese)</a>
<a href="https://github.com/dubbo/php-framework-for-apache-dubbo/wiki/%E9%85%8D%E7%BD%AE%E5%8F%82%E8%80%83%E6%89%8B%E5%86%8C">Configuration guide (Chinese)</a>
# Changelog
- Rewrite the entire code, have better readability, and expand (help more people join in)
- Introduce composer for management loading, which is beneficial for installation and use as a component of other frameworks.
- The original agent module was changed from c + redis to php to reduce component dependencies.
- Provider, consumer, agent and other configuration files are independent of each other, and the storage location is customized.
- Both provider and consumer support serialization of hessian2 data.
- Configuration file format changed from ini to yaml, reducing redundant fields and improving readability.
- Remove log4php log component, provide external log component implementation interface for custom implementation.
- The provider module introduces annotations to register existing code as a dubbo service without modification, without intrusion.
- The swoole_server configuration and callback function can be customized by the user, which is helpful for users to optimize the service according to the current application scenario.
- The TCP connection is maintained while consuming the same ip: port provider.
- The returned hessian serialized data is transformed from a complex object into an array after parsing.
- The data collected by monitor is more complete.


Wiki: [中文](https://github.com/crazyxman/dubbo-php-framework/wiki/%E4%B8%AD%E6%96%87)

8 changes: 0 additions & 8 deletions agent/src/c/Makefile

This file was deleted.

40 changes: 0 additions & 40 deletions agent/src/c/common/fsof_global.h

This file was deleted.

97 changes: 0 additions & 97 deletions agent/src/c/common/fsof_url.c

This file was deleted.

22 changes: 0 additions & 22 deletions agent/src/c/common/fsof_url.h

This file was deleted.

149 changes: 0 additions & 149 deletions agent/src/c/common/fsof_util.c

This file was deleted.

Loading