angelcool-net / riak-client
basho/riak官方客户端的分支,添加了对PHP 8的GET和SET对象的支持,请参阅PHP-8-NOTES.txt。
Requires
- php: >=5.4
- ext-curl: *
- ext-json: *
Requires (Dev)
- apigen/apigen: 4.1.*
- phpunit/phpunit: 4.8.*
This package is auto-updated.
Last update: 2024-09-29 05:49:13 UTC
README
Riak PHP客户端是一个库,它使与Riak(一个开源的、分布式数据库,专注于高可用性、水平可扩展性和可预测的延迟)的通信变得简单。此库使用cURL扩展与Riak的HTTP接口通信。如果您想使用Protocol Buffers接口与Riak通信,请使用官方PHP PB客户端。Riak和此库都由Basho Technologies维护。
要查看可用于与Riak一起使用的其他客户端,请访问我们的文档网站
安装
依赖项
- PHP 5.4+
- PHP扩展:curl、json和openssl [用于安全功能]
- Riak 2.1+
- Composer PHP依赖管理器
Composer安装
此库已被添加到Packagist,以简化安装过程。运行以下composer命令
$ composer require "basho/riak": "3.0.*"
或者,可以将以下内容手动添加到您的composer.json
中的require
部分
"require": { "basho/riak": "3.0.*" }
然后运行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+的功能支持
- 2016年第二季度添加对Riak TS的支持
许可和作者
- 作者:Christopher Mancini (https://github.com/christophermancini)
- 作者:Alex Moore (https://github.com/alexmoore)
- 作者:Luke Bakken (https://github.com/lukebakken)
版权所有(c)2015 Basho Technologies, Inc。根据Apache License,版本2.0(“许可证”)授权。有关更多详细信息,请参阅许可证。