Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP Riak列表存储桶_Php_Riak - Fatal编程技术网

PHP Riak列表存储桶

PHP Riak列表存储桶,php,riak,Php,Riak,我正在尝试使用Riak client for PHP,但我找不到一种方法来获取集群中所有bucket的列表。Riak网站上的文档说它支持Riak,但我找不到任何功能。文档没有提供所有功能。我在文档中找到了followinf函数 /** * Get all buckets. * @return array() of RiakBucket objects */ function buckets() { $url = RiakUtils::buildRestPath($this); $respon

我正在尝试使用Riak client for PHP,但我找不到一种方法来获取集群中所有bucket的列表。Riak网站上的文档说它支持Riak,但我找不到任何功能。

文档没有提供所有功能。我在文档中找到了followinf函数

  /**
* Get all buckets.
* @return array() of RiakBucket objects
*/
function buckets() {
$url = RiakUtils::buildRestPath($this);
$response = RiakUtils::httpRequest('GET', $url.'?buckets=true');
$response_obj = json_decode($response[1]);
$buckets = array();
foreach($response_obj->buckets as $name) {
    $buckets[] = $this->bucket($name);
}
return $buckets;

}

以下是如何使用Riak PHP客户端列出存储桶:

<?php
require_once('riak-php-client/riak.php');
$client = new RiakClient('127.0.0.1', 8091);
$all_buckets = $client->buckets();
var_dump($all_buckets); // etc
?>