I am please to announce the release of SimpleDB 0.9.1, yet another SimpleDB client for PHP. It was designed with the following in mind:
- bulk query and attribute fetching operations
- bulk upload operations (PutAttributes)
- fast execution of as many queries as possible
- proper understandable return values
- proper and clean exception generation
- providing command line utilities to view and manipulate SimpleDB Domains, Items, and Attributes.
- the ability to set domain prefixes for site testing / development
This SimpleDB client requires the following:
- PHP 5.1.4 or greater (
hmac_hash()must be defined) - The Curl extension compiled in.
Please consult the README for installation instructions.
You must, of course, be a member of the SimpleDB Beta program to actually be able to use this.
- Download SimpleDB-0.9.2.tar.bz2 now.
[I’ve rolled out 0.9.2 with a bug fix in it. I’ve actually got a newer version on my hard disk with QueryWithAttributes and sorting support, i just have to finish testing it before uploading]
$sdb->bulkGetAttributes($domain, array('Item1', 'Item2', ...., 'ItemN'));
You can optionally specify a third parameter saying those attributes whose values you want fetched (instead of -all- of them).
Good Luck!
$items = $sdb->query($domain, "['url' != '']");
print_r($items); // prints array( [0] => ['ItemId'] )
$itemattributes = $sdb->bulkGetAttributes($domain, $item);
Results in:
Warning: uksort() [function.uksort]: The argument should be an array in /app/services/SimpleDB.php on line 908
Warning: Invalid argument supplied for foreach() in /app/services/SimpleDB.php on line 1084
Warning: Invalid argument supplied for foreach() in /app/services/SimpleDB.php on line 913
Warning: Invalid argument supplied for foreach() in /app/services/SimpleDB.php on line 1084
Fatal error: Cannot use string offset as an array in /app/services/SimpleDB.php on line 849
Warning: (null)(): 5 is not a valid cURL handle resource in Unknown on line 0
Warning: (null)(): 6 is not a valid cURL handle resource in Unknown on line 0
It looks like there are two bugs here:
1. the code you pasted here should be sending "$items" (with an s) to bulkGetAttributes, not "$item" (no s).
2. my code has a bug where if you give us a 'null', i will generate those errors. I will fix that bug, but in the meantime, if you pass the correct variable, you SHOULD see the correct output.
if that was just a typo in your comment, could you instead describe your data set a little bit and i'll see if i can reproduce the problem.
print_r($items); //returns Array ( [0] => Sebastian Stadil )
Notice the lack of quotes around the item.
Marc, maybe you would be interested in replacing the SimpleDB class in Tarzan-aws with your own code? See here: http://code.google.com/p/tarzan-aws/issues/detail?id=16
I'm not saying one is better than the other -- both classes appear to share a similar philosophy. I just happen to be the developer of Tarzan, so I'm a bit biased. That and I want Tarzan to be able to grow beyond myself. If you've been interested in Tarzan, but haven't looked lately, take another look. http://tarzan-aws.com
Thank for the nice implementation. While testing it, everything seemed OK util I have problem similar to the first mentioned by Sebastian.
//$attributes = $sdb->bulkGetAttributes($domainName, $items, array('e_mail', 'reason'));
$attributes = $sdb->getAttributes($domainName, $items[0], array('e_mail', 'reason'));
The commented code produced the following error list:
Warning: uksort() [function.uksort]: The argument should be an array in lib/SimpleDB.php on line 905
Warning: Invalid argument supplied for foreach() in lib/SimpleDB.php on line 1081
Warning: Invalid argument supplied for foreach() in lib/SimpleDB.php on line 910
Warning: Invalid argument supplied for foreach() in SimpleDB.php on line 1081
Notice: Undefined offset: 0 in lib/SimpleDB.php on line 786
Notice: Undefined offset: 1 in lib/SimpleDB.php on line 786
Fatal error: Cannot use string offset as an array in lib/SimpleDB.php on line 849
Warning: (null)(): 5 is not a valid cURL handle resource in Unknown on line 0
Warning: (null)(): 6 is not a valid cURL handle resource in Unknown on line 0
Any help will be appreciated.
Best,
Georgi
Apologies!! 0.9.2 rolled out.
I used .gz, and not .bz2. Fixed! Sorry for the troubles.
I am very new Amazon Simple DB, and i have just started using your library for it.
Could you please explain, which operating corrosponds to $sdb->query() as i am not able to find it in the amazon documentation. Also, when i use the $sdb->query() it gives me error "The specified query expression syntax is not valid.". Could you please provide with a example syntax for using this function.
Also does you library support amazon select operation, as i am not able to find any function for select operation in your library.
Thanks
Manish



I want to execute multiple GetAttributes in parallel using your library. How could I do so?