mercredi 3 juin 2015

AWS PHP SDK deleteMatchingObjects() does not return count

The AWS PHP SDK documentation for deleteMatchingObjects states that it returns an integer: "Returns the number of deleted keys"

http://ift.tt/1IdEkpq

My media is deleted successfully but I get an empty value back where I'm supposed to get a count of deleted objects. Am I doing something wrong?

This is in the beforeDelete method of a CakePHP 2.x Model Behavior.

$s3 = new Aws\Sdk(array('version' => 'latest', 'region'  => 'us-west-1', 'credentials' => array('key' => $this->s3Key, 'secret' => $this->s3Secret)));
$client = $s3->createS3();
$delete = $client->deleteMatchingObjects($this->s3ReadBucket, $this->fileGroupPrefix($model->name, $model->id));
$this->__logger($delete);




Aucun commentaire:

Enregistrer un commentaire