Hi Collin
If you did not import the class in your php file, you need to use the fully 
qualified name which is \Basho\Riak\Riak like this:

$client = new \Basho\Riak\Riak('127.0.0.1', 8098);

The name change form RiakClient to Riak happened recently (probably as part of 
the PSR1 and PSR2 refactoring).


Br.
Kaspar Bach Pedersen

Den 12/05/2013 kl. 22.38 skrev coLLin LeGault 
<clega...@nextgengeek.com<mailto:clega...@nextgengeek.com>>:

I saw composer.json in riak-php-client and google'd it (never heard of it 
before).  Installed it and ran it and changed my require to:
require_once('./riak-php-client/vendor/autoupdate.php');

Now I am getting this error:

 PHP Fatal error:  Class 'RiakClient' not found in /root/storeinriak.php on 
line 3

Digging further in I don't find any reference to RiakClient in any of the src 
files, but I do find a Riak class. So I changed the source code to new 
Riak('127.0.0.1'. '8098'); only to get the same error, but this time for no 
Riak class.

Is this client library supported? Is anyone using it? I can't find much of 
anything online when searching for any information about using this client 
library. There is an example riak_php_app listed on the basho site from the 
community, but it doesn't exist anymore on github. I found the doxygen docs at 
Basho's website, but even they are out of date: 
http://basho.github.io/riak-php-client/.  Any help would be greatly appreciated.

Thanks in advance,
coLLin



Thanks,
coLLin


email: clega...@nextgengeek.com<mailto:clega...@nextgengeek.com>
web: http://www.nextgengeek.com<http://www.nextgengeek.com/>
twitter: @clegault



On Sun, May 12, 2013 at 3:24 PM, coLLin LeGault 
<clega...@nextgengeek.com<mailto:clega...@nextgengeek.com>> wrote:
Hi folks, I am relatively new to Riak. I was trying to get something working 
with the PHP client library by following the quick start in the README.md. When 
I clone this repo (found here: https://github.com/basho/riak-php-client) I do 
get a directory called riak-php-client, but there is no riak.php in that 
directory.  I found a Riak.php in src/Basho/Riak/, but that doesn't work 
either. Are the docs out of date? The example follows:



require_once('riak-php-client/riak.php');

# Connect to Riak
$client = new RiakClient('127.0.0.1', 8098);

# Choose a bucket name
$bucket = $client->bucket('test');

# Supply a key under which to store your data
$person = $bucket->newObject('riak_developer_1', array(
    'name' => "John Smith",
    'age' => 28,
    'company' => "Facebook"
));

# Save the object to Riak
$person->store();

# Fetch the object
$person = $bucket->get('riak_developer_1');

# Update the object
$person->data['company'] = "Google";
$person->store();

Thanks,
coLLin


email: clega...@nextgengeek.com<mailto:clega...@nextgengeek.com>
web: http://www.nextgengeek.com<http://www.nextgengeek.com/>
twitter: @clegault


_______________________________________________
riak-users mailing list
riak-users@lists.basho.com<mailto:riak-users@lists.basho.com>
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to