aliyun/openapi-sdk-php
소개
Alibaba Cloud V1.0 SDK는 곧 기본 보안 유지 관리 단계에 들어가므로 더 이상 사용을 권장하지 않습니다. V2.0 SDK는 여기에서 사용할 수 있습니다: https://github.com/aliyun/alibabacloud-php-sdk
보안 및 개인정보 보호측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalEnglish | 简体中文
Alibaba Cloud SDK for PHP
The Alibaba Cloud V1.0 PHP SDK has entered the basic security maintenance phase and is no longer recommended for use. New users should directly use the V2.0 PHP SDK; users who have already integrated the V1.0 PHP SDK are also advised to migrate to the V2.0 PHP SDK. V2.0 PHP SDK is available here: https://github.com/aliyun/alibabacloud-php-sdk, for usage, please refer to Help Center Documentation and Alibaba Cloud OpenAPI Developer Portal.
Release Notes
We developed a new kernel on the principle of eliminating known issues and compatible with old grammar, adding the following features:
- Support Composer
- Support for multiple client and client profiles
- Result is a powerful object
- More flexible configuration per request
Prerequisites
Your system will need to meet the Prerequisites, including having PHP >= 5.5. We highly recommend having it compiled with the cURL extension and cURL 7.16.2+.
Installation
If Composer is already installed globally on your system, run the following in the base directory of your project to install Alibaba Cloud SDK for PHP as a dependency:
composer require alibabacloud/sdk
Please see the Installation for more detailed information about installing through Composer and other ways.
Troubleshoot
Troubleshoot Provide OpenAPI diagnosis service to help developers locate quickly and provide solutions for developers through RequestID or error message.
Online Demo
Alibaba Cloud OpenAPI Developer Portal provides the ability to call the cloud product OpenAPI online, and dynamically generate SDK Example code and quick retrieval interface, which can significantly reduce the difficulty of using the cloud API.
Quick Examples
Before you begin, you need to sign up for an Alibaba Cloud account and retrieve your Credentials. Before request, please Understanding the Clients, after request, please Understanding the Result.
Currently, only some Alibaba Cloud products are supported, Supported Products, For products that are not supported, you can use Alibaba Cloud Client for PHP to initiate custom requests, and you can use Alibaba Cloud OpenAPI Developer Portal to generate Alibaba Cloud Client for PHP code online.
<?php
use AlibabaCloud\Client\AlibabaCloud;
use AlibabaCloud\Client\Exception\ClientException;
use AlibabaCloud\Client\Exception\ServerException;
use AlibabaCloud\Ecs\Ecs;
// Set up a global client
AlibabaCloud::accessKeyClient('foo', 'bar')
->regionId('cn-hangzhou')
->asDefaultClient();
try {
// Access product APIs
$request = Ecs::v20140526()->describeRegions();
// Set options/parameters and execute request
$result = $request->withResourceType('type') // API parameter
->withInstanceChargeType('type') // API parameter
->client('client1') // Specify the client for send
->debug(true) // Enable the debug will output detailed information
->connectTimeout(0.01) // Throw an exception when Connection timeout
->timeout(0.01) // Throw an exception when timeout
->request(); // Execution request
// Can also Set by passing in an array
$options = [
'debug' => true,
'connect_timeout' => 0.01,
'timeout' => 0.01,
'query' => [
'ResourceType' => 'type',
'InstanceChargeType' => 'type',
],
];
// Settings priority
$result2 = Ecs::v20140526()
->describeRegions($options)
->options([
'query' => [
'Key' => 'I will overwrite this value in constructor',
'new' => 'I am new value',
],
])
->options([
'query' => [
'Key' => 'I will overwrite the previous value',
'bar' => 'I am new value',
],
])
->debug(false) // Overwrite the true of the former
->request();
} catch (ClientException $exception) {
echo $exception->getMessage(). PHP_EOL;
} catch (ServerException $exception) {
echo $exception->getMessage() . PHP_EOL;
echo $exception->getErrorCode(). PHP_EOL;
echo $exception->getRequestId(). PHP_EOL;
echo $exception->getErrorMessage(). PHP_EOL;
}
Issues
Opening an Issue, Issues not conforming to the guidelines may be closed immediately.
Changelog
Detailed changes for each release are documented in the release notes.
Contribution
Please make sure to read the Contributing Guide before making a pull request.
References
- Alibaba Cloud Regions & Endpoints
- Alibaba Cloud OpenAPI Developer Portal
- Packagist
- Composer
- Guzzle Documentation
- Latest Release
License
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
관련 프로젝트 살펴보기
불러오는 중…