Installation guide

$s3 = new AmazonS3();
$response = $s3->list_parts('my-bucket-name', 'my-object-key', 'my-upload-id', array(
'max-parts' => 10
));
if ($response->isOK())
{
// Loop through and display the part numbers
foreach ($response->body->Part as $part) {
echo "{$part->PartNumber}\n";
}
}
else
{
echo "Error during S3 ListParts operation.\n";
}
From Version 2 of the SDK
<?php
require '/path/to/vendor/autoload.php';
use Aws\Common\Aws;
use Aws\S3\Exception\S3Exception;
$aws = Aws::factory('/path/to/config.php');
$s3 = $aws->get('s3');
try {
$result = $s3->listParts(array(
'Bucket' => 'my-bucket-name',
'Key' => 'my-object-key',
'UploadId' => 'my-upload-id',
'MaxParts' => 10
));
// Loop through and display the part numbers
foreach ($result['Part'] as $part) {
echo "{$part[PartNumber]}\n";
}
} catch (S3Exception $e) {
echo "Error during S3 ListParts operation.\n";
}
Example 2 - Amazon DynamoDB Scan Operation
From Version 1 of the SDK
<?php
require '/path/to/sdk.class.php';
require '/path/to/config.inc.php';
$dynamo_db = new AmazonDynamoDB();
$start_key = null;
Migration Guide
13