1
0

initial commit

This commit is contained in:
frostealth
2016-04-08 15:50:37 +06:00
commit 9cfd06866e
40 changed files with 2312 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace frostealth\yii2\aws\s3\handlers;
use frostealth\yii2\aws\s3\base\handlers\Handler;
use frostealth\yii2\aws\s3\commands\GetPresignedUrlCommand;
/**
* Class GetPresignedUrlCommandHandler
*
* @package frostealth\yii2\aws\s3\handlers
*/
final class GetPresignedUrlCommandHandler extends Handler
{
/**
* @param \frostealth\yii2\aws\s3\commands\GetPresignedUrlCommand $command
*
* @return string
*/
public function handle(GetPresignedUrlCommand $command): string
{
$awsCommand = $this->s3Client->getCommand('GetObject', $command->getArgs());
$request = $this->s3Client->createPresignedRequest($awsCommand, $command->getExpires());
return (string)$request->getUri();
}
}