Skip to content

mvanbaak/aws-sdk-php-v3-bridge-silex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS SDK for PHP - Version 3 Upgrade Bridge Provider for Silex

Latest Stable Version Total Downloads License SensioLabsInsight Codeship build status

A simple Silex service provider for including the AWS SDK for PHP - Version 3 Upgrade Bridge.

Installation

The AWS Service Provider can be installed via Composer by requiring the mvbcoding/aws-sdk-php-v3-bridge-silex package in your project's composer.json.

{
    "require": {
        "mvbcoding/aws-sdk-php-v3-bridge-silex": "^3.0"
    }
}

Usage

Register the AWS Service Provider in your Silex application and provide your AWS SDK for PHP configuration to the app in the aws.config key. $app['aws.config'] should contain an array of configuration options or the path to a configuration file. This value is passed directly into new Aws\SimpleDb\SimpleDbClient.

<?php

require __DIR__ . '/vendor/autoload.php';

use MvbCoding\Silex\AwsV3BridgeServiceProvider;
use Silex\Application;

$app = new Application();

$app->register(new AwsV3BridgeServiceProvider(), array(
    'aws.config' => array(
        'version' => 'latest',
        'region' => 'eu-west-1',
    )
));

$app->match('/', function () use ($app) {
    // Create a list of your SimpleDb Domains
    $domains = $app['aws.simpledb']->listDomains();
    $output = "<ul>\n";
    foreach ($domains['DomainNames'] as $domain) {
        $output .= "<li>{$domain}</li>\n";
    }
    $output .= "</ul>\n";

    return $output;
});

$app->run();

Links

About

Read-only mirror of the official bitbucket hosted repository

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages