phpfastcache / riak-client
Riak PHP 客户端(由于维护者长期不活跃,基于官方 basho/riak 进行了修改)
Requires
- php: >=5.4
- ext-curl: *
- ext-json: *
Requires (Dev)
- apigen/apigen: 4.1.*
- phpunit/phpunit: 4.8.*
Conflicts
- basho/riak: *
This package is auto-updated.
Last update: 2024-09-05 19:04:36 UTC
README
(由于维护者长期不活跃,基于官方 basho/riak 进行了修改)
Riak PHP 客户端 是一个库,它使得与 Riak(一个开源、分布式数据库,专注于高可用性、水平可扩展性和 可预测的延迟)通信变得简单。此库通过 cURL 扩展与 Riak 的 HTTP 接口通信。如果您想使用 Protocol Buffers 接口与 Riak 通信,请使用 官方 PHP PB 客户端。Riak 和此库都由 Basho Technologies 维护。
要查看可用于与 Riak 一起使用的其他客户端,请访问我们的 文档网站
安装
依赖项
- PHP 5.4+(通过 PhpFastCache 提供的 1.4.4 更新,最高支持 PHP 7.2)
- PHP 扩展:curl、json 和 openssl [对于安全功能是必需的]
- Riak 2.1+
- Composer PHP 依赖管理器
Composer 安装
此库已添加到 Packagist 以简化安装过程。运行以下 composer 命令
$ composer require "phpfastcache/riak-client": "^1.4.4"
或者,手动将以下内容添加到您的 composer.json
文件中的 require
部分
"require": { "phpfastcache/riak-client": "^1.4.4" }
然后运行 composer update
确保模块已安装。
文档
此库的 API 文档的完整可遍历版本可以在 Github Pages 上找到。
使用示例
以下是一个使用客户端的简短示例。更多详细的示例代码可以在 示例 中找到。
// lib classes are included via the Composer autoloader files use Basho\Riak; use Basho\Riak\Node; use Basho\Riak\Command; // define the connection info to our Riak nodes $nodes = (new Node\Builder) ->onPort(10018) ->buildCluster(['riak1.company.com', 'riak2.company.com', 'riak3.company.com',]); // instantiate the Riak client $riak = new Riak($nodes); // build a command to be executed against Riak $command = (new Command\Builder\StoreObject($riak)) ->buildObject('some_data') ->buildBucket('users') ->build(); // Receive a response object $response = $command->execute(); // Retrieve the Location of our newly stored object from the Response object $object_location = $response->getLocation();
贡献
此仓库的维护者是 Basho 的工程师,我们欢迎您为此项目做出贡献!您可以首先查看 CONTRIBUTING.md 以了解从测试到编码标准的一切信息。
一个真诚的免责声明
由于我们对稳定性的执着以及我们丰富的用户生态系统,此仓库的社区更新可能需要更长的时间来审查。
贡献最有帮助的方式是通过问题报告您的经验。在内部审查期间,问题可能不会被更新,但我们仍然非常感激。
感谢您成为社区的一部分!我们为此爱您。
路线图
- 当前的开发分支和主分支包含对 Riak 版本 2.1+ 的功能支持
- 支持 Riak TS Q2 2016
许可证和作者
活跃作者
- 作者:Georges.L (https://github.com/Geolim4)
前任作者
- 作者:Christopher Mancini (https://github.com/christophermancini)
- 作者:Alex Moore (https://github.com/alexmoore)
- 作者:Luke Bakken (https://github.com/lukebakken)
版权所有(c)2015 Basho Technologies, Inc. 依据Apache许可证2.0版本(以下简称“许可证”)。更多详情,请参阅许可证。