Download the PHP package chenbool/etcd-v3 without Composer

On this page you can find all versions of the php package chenbool/etcd-v3. 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-v3

Etcd v3 PHP Client

一个基于 chenbool/curl 的 Etcd v3 API PHP 客户端,支持 KV 操作、租约管理、认证授权、集群管理等功能。


📋 目录


✨ 特性

特性 描述
🔑 KV 操作 支持 Put、Get、Delete、Watch 等完整 KV 操作
⏰ 租约管理 支持 Lease 的创建、撤销、续约、TTL 查询
🔐 认证授权 支持用户、角色、权限管理,JWT Token 认证
🏗️ 集群管理 支持成员管理、Leader 转移、快照备份
🔧 维护功能 支持压缩、碎片整理、告警管理
📊 监控接口 支持健康检查、Metrics、Pprof 性能分析

🔧 环境要求

项目 版本
PHP >= 8.1
Etcd >= 3.5
cURL 扩展 已安装

📦 安装


🚀 快速开始


📖 详细使用指南

KV 键值对操作

设置值(Put)

获取值(Get)

删除键(Delete)

监听键变化(Watch)

数据压缩(Compaction)


租约管理

租约用于给键设置生存时间(TTL),适用于临时数据、服务注册等场景。


认证与授权

Etcd 支持基于用户、角色的细粒度访问控制。

启用认证流程

用户管理

角色管理

权限管理

用户角色关联

Token 管理


集群管理

成员管理

Leader 管理


维护操作

状态与版本

快照备份

碎片整理

告警管理

降级管理


监控与调试

健康检查

Metrics

调试信息

Pprof 性能分析


事务操作

事务支持原子性的 Compare-And-Swap 操作。


批量操作


API 参考

构造方法

常量

常量 值 说明
Client::PERMISSION_READ 0 只读权限
Client::PERMISSION_WRITE 1 只写权限
Client::PERMISSION_READWRITE 2 读写权限

配置方法

方法 参数 返回值 说明
setToken(string $token) Token 字符串 void 设置认证 Token
clearToken() - void 清除 Token
getToken() - ?string 获取当前 Token
getHost() - string 获取主机地址
getPort() - int 获取端口号
getTimeout() - int 获取超时时间
setTimeout(int $timeout) 超时秒数 void 设置超时时间
setHost(string $host) 主机地址 void 设置主机地址
setPort(int $port) 端口号 void 设置端口号
getUrl() - string 获取完整 URL

📋 完整示例

详见 index.php 文件,包含所有功能的完整演示:

输出示例:


📂 项目结构


🔗 相关链接


📄 许可证

MIT License


All versions of etcd-v3 with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
chenbool/curl 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 chenbool/etcd-v3 contains the following files

Loading the files please wait ...