Download the PHP package chemezov/yii2-yandex-cloud without Composer
On this page you can find all versions of the php package chemezov/yii2-yandex-cloud. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-yandex-cloud
Yii2 Yandex Cloud
An Yandex Cloud component for Yii2 (forked from Amazon S3 Yii2 component).
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
Получить статические ключи доступа
https://cloud.yandex.ru/docs/iam/operations/sa/create-access-key.
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.