start-point-fix/etcd-php
Composer 安装命令:
composer require start-point-fix/etcd-php
包简介
PHP client for Etcd v3
README 文档
README
PHP client for Etcd v3
Requirements
- PHP5.5+
- Composer
Installation
composer require start-point/etcd-php
Usage
<?php require 'vendor/autoload.php'; $client = new \Etcd\Client('127.0.0.1:2379'); /*********** kv ***********/ // set value $client->put('redis', '127.0.0.1:6379'); // set value and return previous value $client->put('redis', '127.0.0.1:6579', ['prev_kv' => true]); // set value with lease $client->put('redis', '127.0.0.1:6579', ['lease' => 7587822882194199413]); // get key value $client->get('redis'); // get all keys $client->getAllKeys(); // get keys with prefix $client->getKeysWithPrefix('/v3/service/user/'); // delete key $client->del('redis'); // compaction $client->compaction(7); /************ lease *****************/ $client->grant(3600); // grant with ID $client->grant(3600, 7587822882194199413); // revoke a lease $client->revoke(7587822882194199413); // keep the lease alive $client->keepAlive(7587822882194199413); // retrieve lease information $client->timeToLive(7587822882194199413); /************ auth role user **************/ // enable authentication $client->authEnable(); // disable authentication $client->authDisable(); // get auth token $client->authenticate('user', 'password'); // set auth token $client->setToken($token); // clear auth token $client->clearToken(); // add a new role $client->addRole('root'); // get detailed role information $client->getRole('root'); // delete a specified role $client->deleteRole('root'); // get lists of all roles $client->roleList(); // add a new user $client->addUser('user', 'password'); // get detailed user information $client->getUser('root'); // delete a specified user $client->deleteUser('root'); // get a list of all users. $client->userList(); // change the password of a specified user $client->changeUserPassword('user', 'new password'); // grant a role to a specified user $client->grantUserRole('user', 'role'); // revoke a role of specified user $client->revokeUserRole('user', 'role'); // grant a permission of a specified key or range to a specified role $client->grantRolePermission('admin', \Etcd\Client::PERMISSION_READWRITE, 'redis'); // revoke a key or range permission of a specified role $client->revokeRolePermission('admin', 'redis');
start-point-fix/etcd-php 适用场景与选型建议
start-point-fix/etcd-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 122 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 07 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「etcd」 「etcdv3」 「etcd-client」 「etcd-php」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 start-point-fix/etcd-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 start-point-fix/etcd-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 start-point-fix/etcd-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP client for Etcd v3
Grpc PHP Client base on Swoole Http2 Coroutine
Fork of PHP client for Etcd v3
Grpc PHP Client base on Swoole Http2 Coroutine
Elasticsearch service and migrations using etcd credentials for connection.
HyperF reimplementations and utils
统计信息
- 总下载量: 122
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-09