asilgag/aws-cli-wrapper
最新稳定版本:v1.0.0
Composer 安装命令:
composer require asilgag/aws-cli-wrapper
包简介
A simple PHP wrapper over AWS CLI command
README 文档
README
A simple PHP wrapper over CLI commands.
Installation
composer require asilgag/aws-cli-wrapper
Usage
use Asilgag\CliWrapper\AWS\AwsCliWrapper;
use Asilgag\CliWrapper\CliCommand;
// Create a new AWS CLI Wrapper.
$awsCli = new AwsCliWrapper();
// Set credentials if needed.
$awsCli->setEnvironment('AWS_ACCESS_KEY_ID', '***');
$awsCli->setEnvironment('AWS_SECRET_ACCESS_KEY', '***');
// Set options for the "aws" part of the command.
// @see https://docs.aws.amazon.com/cli/latest/reference/
$awsCli->getAwsOptions()->add('--region us-east-1');
// Set global options for specific commands.
// In this example, all "s3" commands will be suffixed with "--only-show-errors".
// @see https://docs.aws.amazon.com/cli/latest/reference/s3/
$awsCli->getGlobalOptions('s3')->add('--only-show-errors');
// Create new command.
$command = new CliCommand('s3', ['sync', '/source/path/', 's3://bucket/', '--include *.html', '--delete']);
// Execute command. It will throw a RuntimeException if it exits with a non-zero code.
try {
$cli->exec($command);
}
catch (RuntimeException $e) {
// Do some logging
}
统计信息
- 总下载量: 9.19k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-04