Download the PHP package bilberrry/yii2-digitalocean-spaces without Composer
On this page you can find all versions of the php package bilberrry/yii2-digitalocean-spaces. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bilberrry/yii2-digitalocean-spaces
More information about bilberrry/yii2-digitalocean-spaces
Files in bilberrry/yii2-digitalocean-spaces
Package yii2-digitalocean-spaces
Short Description DigitalOcean Spaces component for Yii2
License MIT
Homepage https://github.com/bilberrry/yii2-digitalocean-spaces
Informations about the package yii2-digitalocean-spaces
Yii2 DigitalOcean Spaces
DigitalOcean Spaces component for Yii2. Based on frostealth/yii2-aws-s3.
Installation
-
Run the Composer command to install the latest version:
- Add the component to config:
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 HasSpace and HasAcl interfaces allows the command builder to set the values
of space 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 DigitalOcean Spaces is licensed under the MIT License.
See the LICENSE file for more information.