2amigos / yiiaws

Amazon Web Services SDK PHP 2 Wrapper
21 stars 15 forks source link

error with getCommand #19

Closed jzy1688 closed 11 years ago

jzy1688 commented 11 years ago

when I try to execute "$s3->getCommand('GetObject',array('Bucket'=>$bucket,'Key'=$key));" I got an Error :"Argument 2 passed to Guzzle\Service\Client::getCommand() must be an array, string given, called in /Library/WebServer/Documents/protected/extensions/aws/components/A2Base.php on line 85 and defined"

and I think it may be some proble with getCommand since I also tried to use getCommand to CreateBucket but got the same error

jordigg commented 11 years ago

Same problem here with the test code. The problem is in the A2base.php file.

I have changed line 76 for:

if($args == false){
    $args = array();
}else{
    $args = current($args);
}

$args expect an array value, when is empty throw an error. So when is empty we give them an empty array as a value and everything will be ok.

tonydspaniard commented 11 years ago

This issue has been fixed... thanks