AWS Resource APIs for PHP

<?php
 
require 'vendor/autoload.php';
 
use Aws\Resource\Aws;
 
$aws = new Aws([
    'region'  => 'us-west-2',
    'version' => 'latest',
    'profile' => 'your-credential-profile',
]);

$bucket = $aws->s3->bucket('your-bucket');

$object = $bucket->putObject([
    'Key'  => 'images/image001.jpg',
    'Body' => fopen('/path/to/image.jpg', 'r'),
]);

The core AWS SDK for PHP is composed of service client objects that have methods corresponding 1-to-1 with operations in the service’s API. This project builds build upon the SDK to add new types of objects that allow you to interact with the AWS service APIs in a more resource-oriented way. This allows you to use a more expressive syntax when working with AWS services, because you are acting on objects that understand their relationships with other resources and that encapsulate their identifying information.

Yes!

Preview the AWS Resource APIs for PHP →
AWS Resource APIs for PHP (GitHub) →

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.