basho/riak-php-client — Issue #24: The Function buildRestPath format incorrect for latest versions
Author: geckoeffect
Created: 2012-03-08 12:01:23+00:00
State: open

riak request format has changed
GET /riak/bucket/key # Old format
GET /buckets/bucket/keys/key # New format
as referenced here
http://wiki.basho.com/HTTP-Fetch-Object.html
http://wiki.basho.com/HTTP-Store-Object.html
http://wiki.basho.com/HTTP-Delete-Object.html

the format in the function is formatted as below and is now incorrect
# Build 'http://hostname:port/prefix/bucket'

a quick fix is to make the following changes

// $path.= '/' . $client->prefix; //****************** no longer required - comment out

# Add '.../bucket'
if (!is_null($bucket) && $bucket instanceof RiakBucket) {
$path .= '/buckets/' . urlencode($bucket->name); //****************** add /buckets to the path
}

# Add '.../key'
if (!is_null($key)) {
$path .= '/keys/' . urlencode($key); //****************** add /keys to the path
}

hope this helps