Download the PHP package rtek/aws-gen without Composer
On this page you can find all versions of the php package rtek/aws-gen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package aws-gen
Short Description Generate PHP classes for AWS services, operations and types
License MIT
Homepage https://github.com/rtek/aws-gen
Informations about the package aws-gen
AwsGen - PHP classes for the AWS SDK
AwsGen generates strictly typed PHP classes that allow you to use Amazon Web Services with objects instead of arrays.
Installation
\Rtek\AwsGen
has no runtime component, so require it as a development dependency:
Why Bother?
AWS has approximately 170 services with ~18,000 types. The SDK provides access
to these services using \ArrayAccess
and rich runtime metadata,
but does not offer code-completion by realizing the API in PHP classes*.
\Rtek\AwsGen
will generate PHP classes for the services and operations that
you choose, while allowing you to use the underlying SDK at all times.
You can treat these classes as read-only, or embed them in your project as the basis for more sophisticated wrappers.
*If you used AwsGen for all services, there would be ~10x the number of files as the SDK
An Example: S3 Service
Console generation
PHP generation
Usage
Terms
Service
- An AWS service that has a
Client
and metadata - Contains multiple
Operation
andShape
- e.g.
S3
,DynamoDb
,Ec2
- An AWS service that has a
Operation
- An AWS API call that does something
- Has an
Input
and anOutput
- e.g.
DynamoDb\DynamoDbClient::putItem()
,S3\S3Client::getObject()
Shape
- An AWS type that can be serialized as an associative array
- Accessors are read and write
- e.g.
S3\ObjectList
,Ec2\Instance
Input
- A
Shape
that contains the input parameters for anOperation
- Defines the expected
Output
for anOperation
- Accessors are write-only
- e.g.
DynamoDb\PutItemInput
,S3\ListObjectRequest
- A
Output
- A
Shape
that contains the result of anOperation
- Extends
\Aws\Result
- Accessors are read-only
- e.g.
DynamoDb\PutItemOutput
,S3\ListObjectOutput
- A
Client
- Extends the corresponding SDK client
- Marshals an
Input
to the SDKOperation
and returns theOutput
- e.g.
S3\S3Client
,DynamoDb\DynamoDbClient
Issues / Quriks
- Paginators are not implemented
- CommandPools are not implemented
\Aws\Result::$data
is passed by value toOutput
classes_
will be appended the PHP class name when:- A service contains two types with identical case-insensitive names
- A type is a PHP keyword
- Some service names are oddly named vs the namespace: e.g.
streams.dynamodb => DynamoDbStreams
- Some
Input
classes use the termRequest
instead ofInput
per the SDK metadata
Acknowledgements
- Inspired by goetas-webeservices/xsd2php
All versions of aws-gen with dependencies
aws/aws-sdk-php Version ^3.0
symfony/console Version ^4.0
zendframework/zend-code Version ^3.3
psr/log Version ^1.1