Download the PHP package frostealth/yii2-aws-s3 without Composer
On this page you can find all versions of the php package frostealth/yii2-aws-s3. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download frostealth/yii2-aws-s3
More information about frostealth/yii2-aws-s3
Files in frostealth/yii2-aws-s3
Package yii2-aws-s3
Short Description An Amazon S3 component for Yii2
License MIT
Homepage https://github.com/frostealth/yii2-aws-s3
Informations about the package yii2-aws-s3
Yii2 AWS S3
An Amazon S3 component for Yii2.
Yii2 AWS S3 uses SemVer.
Version 2.x requires PHP 7. For PHP less 7.0 use 1.x.
Installation
-
Run the Composer command to install the latest version:
- Add the component to
config/main.php
Basic usage
Usage of the command factory and additional params
Short syntax
Asynchronous execution
Advanced usage
Custom commands
Commands have two types: plain commands that's handled by the PlainCommandHandler
and commands with their own handlers.
The plain commands wrap the native AWS S3 commands.
The plain commands must implement the PlainCommand
interface and the rest must implement the Command
interface.
If the command doesn't implement the PlainCommand
interface, it must have its own handler.
Every handler must extend the Handler
class or implement the Handler
interface.
Handlers gets the S3Client
instance into its constructor.
The implementation of the HasBucket
and HasAcl
interfaces allows the command builder to set the values
of bucket and acl by default.
To make the plain commands asynchronously, you have to implement the Asynchronous
interface.
Also, you can use the Async
trait to implement this interface.
Consider the following command:
The handler for this command looks like this:
And usage this command:
Custom plain command looks like this:
Any command can extend the ExecutableCommand
class or implement the Executable
interface that will
allow to execute this command immediately: $command->withSomething('some value')->execute();
.
License
Yii2 AWS S3 is licensed under the MIT License.
See the LICENSE file for more information.