{"id":15773993,"url":"https://github.com/aliyun/openapi-sdk-php-client","last_synced_at":"2025-05-14T20:07:25.952Z","repository":{"id":50288682,"uuid":"159604590","full_name":"aliyun/openapi-sdk-php-client","owner":"aliyun","description":"Official repository of the Alibaba Cloud Client for PHP","archived":false,"fork":false,"pushed_at":"2024-10-17T03:29:10.000Z","size":1692,"stargazers_count":220,"open_issues_count":7,"forks_count":54,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-19T05:36:47.845Z","etag":null,"topics":["alibaba","alibabacloud","aliyun","client","cloud","composer","php","region","sdk"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/alibabacloud/client","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aliyun.png","metadata":{"files":{"readme":"README-zh-CN.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-29T03:54:18.000Z","updated_at":"2024-09-14T09:40:10.000Z","dependencies_parsed_at":"2024-06-18T10:59:46.003Z","dependency_job_id":"fd00ca8b-e52a-42a0-9443-7bc7428b82fa","html_url":"https://github.com/aliyun/openapi-sdk-php-client","commit_stats":{"total_commits":234,"total_committers":10,"mean_commits":23.4,"dds":"0.48290598290598286","last_synced_commit":"11db11afd6a05cef9bd49a63a3fea379d075412a"},"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Fopenapi-sdk-php-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Fopenapi-sdk-php-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Fopenapi-sdk-php-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Fopenapi-sdk-php-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliyun","download_url":"https://codeload.github.com/aliyun/openapi-sdk-php-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248732486,"owners_count":21152852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alibaba","alibabacloud","aliyun","client","cloud","composer","php","region","sdk"],"created_at":"2024-10-04T16:04:21.285Z","updated_at":"2025-04-13T15:10:20.745Z","avatar_url":"https://github.com/aliyun.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[English](/README.md) | 简体中文\n\n\n# Alibaba Cloud Client for PHP\n[![Latest Stable Version](https://poser.pugx.org/alibabacloud/client/v/stable)](https://packagist.org/packages/alibabacloud/client)\n[![composer.lock](https://poser.pugx.org/alibabacloud/client/composerlock)](https://packagist.org/packages/alibabacloud/client)\n[![Total Downloads](https://poser.pugx.org/alibabacloud/client/downloads)](https://packagist.org/packages/alibabacloud/client)\n[![License](https://poser.pugx.org/alibabacloud/client/license)](https://packagist.org/packages/alibabacloud/client)\n[![codecov](https://codecov.io/gh/aliyun/openapi-sdk-php-client/branch/master/graph/badge.svg?token=90Yd5Bne3S)](https://codecov.io/gh/aliyun/openapi-sdk-php-client)\n[![PHP Version Require](http://poser.pugx.org/alibabacloud/client/require/php)](https://packagist.org/packages/alibabacloud/client)\n\n\n![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)\n\n\n阿里云 V1.0 SDK 即将进入基础安全维护阶段，不再建议使用，建议使用 V2.0 SDK。\n\n\n## 使用诊断\n[Troubleshoot](https://api.aliyun.com/troubleshoot?source=github_sdk) 提供 OpenAPI 使用诊断服务，通过 `RequestID` 或 `报错信息` ，帮助开发者快速定位，为开发者提供解决方案。\n\n## 在线示例\n[阿里云 OpenAPI 开发者门户]https://api.aliyun.com/) 提供在线调用阿里云产品，并动态生成 SDK 代码和快速检索接口等能力，能显著降低使用云 API 的难度。\n\n\n## 先决条件\n您的系统需要满足[先决条件](/docs/zh-CN/0-Prerequisites.md)，包括 PHP\u003e = 5.5。 我们强烈建议使用cURL扩展，并使用TLS后端编译cURL 7.16.2+。\n\n\n## 安装依赖\n如果已在系统上[全局安装 Composer](https://getcomposer.org/doc/00-intro.md#globally)，请直接在项目目录中运行以下内容来安装 Alibaba Cloud Client for PHP 作为依赖项：\n```\ncomposer require alibabacloud/client\n```\n\u003e 一些用户可能由于网络问题无法安装，可以使用[阿里云 Composer 全量镜像](https://developer.aliyun.com/composer)。\n\n请看[安装](/docs/zh-CN/1-Installation.md)有关通过 Composer 和其他方式安装的详细信息。\n\n\n## 快速使用\n在您开始之前，您需要注册阿里云帐户并获取您的[凭证](https://usercenter.console.aliyun.com/#/manage/ak)。\n\n```php\n\u003c?php\n\nuse AlibabaCloud\\Client\\AlibabaCloud;\n\nAlibabaCloud::accessKeyClient('accessKeyId', 'accessKeySecret')-\u003easDefaultClient();\n```\n\n\n## 请求\n\u003e 请求风格分为 `ROA` 和 `RPC`，不同产品风格不同，使用前，请参考产品文档。推荐使用 [Alibaba Cloud SDK for PHP][SDK] ，细节已被封装，无需关心风格。\n\n\n### ROA 请求\n```php\n\u003c?php\n\nuse AlibabaCloud\\Client\\AlibabaCloud;\nuse AlibabaCloud\\Client\\Exception\\ClientException;\nuse AlibabaCloud\\Client\\Exception\\ServerException;\n\ntry {\n    $result = AlibabaCloud::roa()\n                          -\u003eregionId('cn-hangzhou') // 指定请求的区域，不指定则使用客户端区域、默认区域\n                          -\u003eproduct('CS') // 指定产品\n                          -\u003eversion('2015-12-15') // 指定产品版本\n                          -\u003eaction('DescribeClusterServices') // 指定产品接口\n                          -\u003eserviceCode('cs') // 设置 ServiceCode 以备寻址，非必须\n                          -\u003eendpointType('openAPI') // 设置类型，非必须\n                          -\u003emethod('GET') // 指定请求方式\n                          -\u003ehost('cs.aliyun.com') // 指定域名则不会寻址，如认证方式为 Bearer Token 的服务则需要指定\n                          -\u003epathPattern('/clusters/[ClusterId]/services') // 指定ROA风格路径规则\n                          -\u003ewithClusterId('123456') // 为路径中参数赋值，方法名：with + 参数\n                          -\u003erequest(); // 发起请求并返回结果对象，请求需要放在设置的最后面\n\n    print_r($result-\u003etoArray());\n    \n} catch (ClientException $exception) {\n    print_r($exception-\u003egetErrorMessage());\n} catch (ServerException $exception) {\n    print_r($exception-\u003egetErrorMessage());\n}\n```\n\n### RPC 请求\n```php\n\u003c?php\n\nuse AlibabaCloud\\Client\\AlibabaCloud;\nuse AlibabaCloud\\Client\\Exception\\ClientException;\nuse AlibabaCloud\\Client\\Exception\\ServerException;\n\ntry {\n    $result = AlibabaCloud::rpc()\n                          -\u003eproduct('Cdn')\n                          -\u003eversion('2014-11-11')\n                          -\u003eaction('DescribeCdnService')\n                          -\u003emethod('POST')\n                          -\u003erequest();\n\n    print_r($result-\u003etoArray());\n\n} catch (ClientException $exception) {\n    print_r($exception-\u003egetErrorMessage());\n} catch (ServerException $exception) {\n    print_r($exception-\u003egetErrorMessage());\n}\n```\n\n\n## 文档\n* [先决条件](/docs/zh-CN/0-Prerequisites.md)\n* [安装](/docs/zh-CN/1-Installation.md)\n* [客户端和凭证](/docs/zh-CN/2-Client.md)\n* [请求](/docs/zh-CN/3-Request.md)\n* [结果](/docs/zh-CN/4-Result.md)\n* [区域](/docs/zh-CN/5-Region.md)\n* [域名](/docs/zh-CN/6-Host.md)\n* [SSL 验证](/docs/zh-CN/7-Verify.md)\n* [调试](/docs/zh-CN/8-Debug.md)\n* [日志](/docs/zh-CN/9-Log.md)\n* [测试](/docs/zh-CN/10-Test.md)\n\n\n## 问题\n[提交 Issue](https://github.com/aliyun/openapi-sdk-php-client/issues/new/choose)，不符合指南的问题可能会立即关闭。\n\n\n## 发行说明\n每个版本的详细更改记录在[发行说明](/CHANGELOG.md)中。\n\n\n## 贡献\n提交 Pull Request 之前请阅读[贡献指南](/CONTRIBUTING.md)。\n\n\n## 相关\n* [阿里云服务 Regions \u0026 Endpoints][endpoints]\n* [阿里云 OpenAPI 开发者门户][open-api]\n* [Packagist][packagist]\n* [Composer][composer]\n* [Guzzle中文文档][guzzle-docs]\n* [最新源码][latest-release]\n\n\n## 许可证\n[Apache-2.0](/LICENSE.md)\n\nCopyright (c) 2009-present, Alibaba Cloud All rights reserved.\n\n\n[SDK]: https://github.com/aliyun/openapi-sdk-php\n[open-api]: https://api.aliyun.com/\n[latest-release]: https://github.com/aliyun/openapi-sdk-php-client\n[guzzle-docs]: https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html\n[composer]: https://getcomposer.org\n[packagist]: https://packagist.org/packages/alibabacloud/sdk\n[home]: https://home.console.aliyun.com\n[aliyun]: https://www.aliyun.com\n[regions]: https://help.aliyun.com/document_detail/40654.html\n[endpoints]: https://developer.aliyun.com/endpoints\n[cURL]: http://php.net/manual/zh/book.curl.php\n[OPCache]: http://php.net/manual/zh/book.opcache.php\n[xdebug]: http://xdebug.org\n[OpenSSL]: http://php.net/manual/zh/book.openssl.php\n[client]: https://github.com/aliyun/openapi-sdk-php-client\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliyun%2Fopenapi-sdk-php-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliyun%2Fopenapi-sdk-php-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliyun%2Fopenapi-sdk-php-client/lists"}