dew-serverless / acs-sdk-php
非官方的阿里云PHP SDK。
v0.3.0+20240928
2024-10-03 07:25 UTC
Requires
- php: ^8.2
- guzzlehttp/psr7: ^2.7
- php-http/client-common: ^2.7
- php-http/discovery: ^1.0
- psr/http-client-implementation: ^1.0
- psr/http-factory: ^1.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.59
- google/protobuf: ^4.27
- mockery/mockery: ^1.6
- nyholm/psr7: ^1.0
- php-http/mock-client: ^1.0
- phpstan/phpstan: ^1.11
- phpstan/phpstan-mockery: ^1.1
- phpunit/phpunit: ^11.2
- rector/rector: ^1.1
- symfony/var-exporter: ^7.1
Suggests
- ext-lz4: Allows Protobuf compression with lz4 in SLS
- ext-zstd: Allows Protobuf compression with zstd in SLS
- google/protobuf: Required for Tablestore management.
This package is auto-updated.
Last update: 2024-10-03 07:28:17 UTC
README
⚠️ 重要: 此包处于早期开发阶段,可能会随时进行重大更改。如果您计划在生产环境中使用此SDK,请注意,此类更改可能会影响您的应用程序。
非官方SDK使用阿里云OpenAPI元数据,设计成HTTP客户端无关。鉴于阿里云提供的广泛服务,我们旨在保持其简单、可重用和维护。即使您更喜欢自己构建API请求,我们也可以帮助您进行请求签名,让您免受签名计算复杂性的困扰。
快速开始
安装
您可以使用以下命令使用 Composer 安装SDK
composer require dew-serverless/acs-sdk-php
用法
客户端遵循 <产品>Client
的命名约定。例如,使用VPC,让我们为我们的优秀项目创建一个新的网络
use Dew\Acs\Vpc\VpcClient; $client = new VpcClient([ 'region' => 'cn-shenzhen', 'credentials' => [ 'key' => '<YOUR_ACCESS_KEY_ID>', 'secret' => '<YOUR_ACCESS_KEY_SECRET>', ], ]); $result = $client->createVpc([ 'RegionId' => 'cn-shenzhen', ]); echo $result['VpcId']; // retrieve the newly-created VPC ID.
您可以将参数作为数组传递给服务。有关您可以包含的其他字段的详细信息,请参阅官方产品文档。