Thank you! This worked, and now that you mentioned the class import I found how to do that as well.
I guess the documentation needs a lot of updating to keep up with the code. I really appreciate your help! Thanks, coLLin On Monday, May 13, 2013, Kaspar Pedersen <k...@trifork.com> wrote: > 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 > > -- *CoLLin LeGault* NextGenGeek | e: clega...@nextgengeek.com | w: http://www.nextgengeek.com [image: Facebook] <http://www.facebook.com/clegault> [image: Twitter]<http://www.twitter.com/clegault> [image: LinkedIn] <http://www.linkedin.com/in/clegault> [image: Flickr]<http://www.flickr.com/photos/clegault27> [image: about.me] <http://about.me/collin> [image: Facebook Page]<https://www.facebook.com/SafTieApp> [image: Google Plus] <http://plus.google.com/105707590277421558753>
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com