alibabacloud/sdk
最新稳定版本:1.8.2334
Composer 安装命令:
composer require alibabacloud/sdk
包简介
Alibaba Cloud SDK for PHP - Easier to Use Alibaba Cloud in your PHP project
README 文档
README
English | 简体中文
Alibaba Cloud SDK for PHP
The Alibaba Cloud V1.0 SDK will soon enter the Basic Security Maintenance phase and is no longer recommended for use. It is suggested to use the V2.0 SDK instead.
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.
alibabacloud/sdk 适用场景与选型建议
alibabacloud/sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2M 次下载、GitHub Stars 达 529, 最近一次更新时间为 2019 年 01 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「library」 「sdk」 「cloud」 「aliyun」 「alibaba」 「alibabacloud」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 alibabacloud/sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alibabacloud/sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 alibabacloud/sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A SDK for working with B2 cloud storage.
Small library to access Microsoft Windows Azure Blob Storage with a Service or a StreamWrapper.
UCloud Resource (Cloud) Storage SDK for PHP
The flysystem adapter for yandex disk rest api.
A sleek PHP wrapper around rclone with Laravel-style fluent API syntax
非官方云小票机SDK,支持飞鹅云,芯烨云,易联云,快递100,映美云,中午云,佳博云,优声云,365智能云打印等
统计信息
- 总下载量: 2M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 552
- 点击次数: 33
- 依赖项目数: 66
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2019-01-03