Download the PHP package phpone/canal_php without Composer
On this page you can find all versions of the php package phpone/canal_php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package canal_php
canal_php
canal php client
Install
使用
- config/canal.php 文件复制到项目目录,并修改自己的配置
- test/bin/start.php 文件复制到项目目录, 请根据项目目录层级注意修改start.php的相应目录 BASE_DIR、CONFIG_DIR
启动
请使用supervisor配置脚本,防止异常退出
配置说明
目录说明
- config 项目配置文件,自定义即可
- src
- CanalClient 处理脚本
- ClientIdentity 客户端类
- Config 读取config/目录中的配置
- Message 接收消息列表
- PacketUtil 工具包
- test 测试
- bin 启动脚本
- MessageHandler 业务处理逻辑,自定义即可
处理逻辑
主要处理流程根据java版的canal_client参考来完成,其实就是c/s完成tcp数据传输的过程,我们需要了解
- protocolBuf的基本使用,这是一种跨语言的序列化协议,跟json、xml是一个意思
- canalServer中netty对于tcp的包处理,固定包头+包体 FixedLengthFrameDecoder解码器的原理
- 通信的流程client->protocol->tcp->server->tcp->protocol->client
参考项目
- java client : https://github.com/alibaba/canal/tree/master/client
- php client: https://github.com/xingwenge/canal-php
- swoole client : https://wiki.swoole.com/#/learn?id=tcp%e7%b2%98%e5%8c%85%e9%97%ae%e9%a2%98
All versions of canal_php with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.2
ext-swoole Version >=4.5
google/protobuf Version ^3.13
vlucas/phpdotenv Version ^5.1
ext-swoole Version >=4.5
google/protobuf Version ^3.13
vlucas/phpdotenv Version ^5.1
The package phpone/canal_php contains the following files
Loading the files please wait ....