dew-serverless / acs-sdk-php
Unofficial Alibaba Cloud PHP SDK.
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-11-23 13:22:29 UTC
README
⚠️ Important: This package is in the early stages of development and may undergo breaking changes at any time. If you plan to use this SDK in a production environment, please be aware that such changes could impact your application.
The unofficial SDK utilizes Alibaba Cloud OpenAPI metadata and is designed to be HTTP client-agnostic. We aim to keep it simple, reusable, and maintainable, given the wide range of services offered by Alibaba Cloud. Even if you prefer to craft your own API requests, we can assist with request signing, sparing you from the complexities of signature calculations.
Quickstart
Install
The SDK can be installed using Composer with the following command:
composer require dew-serverless/acs-sdk-php
Usage
Clients follow the naming convention of <Product>Client
. For example, with
VPC, let's create a new network for our awesome project:
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.
You can pass arguments to the service as an array. For details on additional fields you can include, please refer to the official product documentation.