Download the PHP package erikwang2013/etcd without Composer

On this page you can find all versions of the php package erikwang2013/etcd. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package etcd

erikwang2013/etcd

PHP etcd v3 客户端 — gRPC + HTTP 双模传输,全功能 API,支持 Laravel / Hyperf / ThinkPHP / Webman

要求

安装

快速开始

配置

环境变量

不传配置时自动读取环境变量:

变量 默认值 说明
ETCD_ENDPOINTS 127.0.0.1:2379 逗号分隔的多节点地址
ETCD_TRANSPORT auto auto / http / grpc
ETCD_TIMEOUT 5.0 请求超时(秒)
ETCD_RETRY 2 连接重试次数
ETCD_USER etcd 用户名
ETCD_PASSWORD etcd 密码

API 参考

KV — 键值操作

比较目标(target)常量: 0=VERSION, 1=CREATE, 2=MOD, 3=VALUE, 4=LEASE
比较结果(result)常量: 0=EQUAL, 1=GREATER, 2=LESS, 3=NOT_EQUAL

Watch — 变更监听

断线重连: Watch 连接断开时自动从上一次收到的 revision 续订,不会丢失事件。

Lease — 租约

典型场景: 服务注册时创建租约 + 写入 key,定时调用 keepAlive() 心跳续约;服务停止后租约到期自动清理。

Auth — 认证与权限

注意: 开启认证后,客户端必须配置 auth.userauth.password 才能继续操作。

Cluster — 集群管理

Maintenance — 运维

传输模式

模式 状态 依赖 适用场景
HTTP 可用 PSR-18 + PSR-17 零扩展依赖,即刻可用
gRPC 骨架 ext-grpc + grpc/grpc + google/protobuf 高性能、原生流式
auto 默认 自动检测 有 gRPC 则用 gRPC,否则 HTTP

auto 模式检测逻辑:

  1. extension_loaded('grpc') — C 扩展已加载?
  2. class_exists('Grpc\BaseStub')grpc/grpc composer 包已安装?

两者都满足才走 gRPC,否则回退 HTTP。

手动配置 PSR-18 HTTP 客户端

框架集成

Laravel

安装即用。composer.json 的 extra.laravel 自动发现 ServiceProvider 和 Facade。

发布配置文件:

.env 配置:

Hyperf

安装即用。Hyperf 自动发现 ConfigProvider

发布配置:

ThinkPHP

  1. 安装后,在 app/service.php 中注册:

  2. 创建 config/etcd.php 配置文件。

使用:

Webman

安装即用,无需额外配置。

如需自定义配置,编辑 plugin/erikwang2013/etcd/config/etcd.php

异常处理

目录结构

开源不易,欢迎支持

微信 支付宝

License

MIT — Copyright (c) 2026 erik [email protected]


All versions of etcd with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package erikwang2013/etcd contains the following files

Loading the files please wait ...