Skip to content

Commit

Permalink
update docs (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
宋神宗 authored Mar 19, 2019
1 parent aace795 commit e8d93d6
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 77 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 1.0.21 - 2019-03-19
- Installing by Using the ZIP file.
- Update Docs.


## 1.0.20 - 2019-03-13
- Improve Tests.
- Update Docs.
Expand Down
43 changes: 10 additions & 33 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,19 @@
**Alibaba Cloud Client for PHP** 是帮助 PHP 开发者管理凭据、发送请求的客户端工具,[Alibaba Cloud SDK for PHP][SDK] 由本工具提供底层支持。


## 要求
- 您必须使用 PHP 5.5.0 或更高版本。
- 如果您使用了 `RsaKeyPair` 客户端(仅支持日本站),还需要 [OpenSSL PHP 扩展][OpenSSL]


## 建议
- 使用 [Composer][composer] 并优化自动加载 `composer dump-autoload --optimize`
- 安装 [cURL][cURL] 7.16.2 或更高版本
- 使用 [OPCache][OPCache]
- 生产环境中不要使用 [Xdebug][xdebug]


## 在线示例
[API Explorer](https://api.aliyun.com) 提供在线调用阿里云产品,并动态生成 SDK 代码和快速检索接口等能力,能显著降低使用云 API 的难度,强烈推荐使用。


## 安装
> 安装 Alibaba Cloud Client for PHP,您必须掌握如何使用 [Composer][composer]
<br/>
[API Explorer](https://api.aliyun.com) 提供在线调用阿里云产品,并动态生成 SDK 代码和快速检索接口等能力,能显著降低使用云 API 的难度。

1. 下载并安装 Composer(Windows 用户请下载并运行 [Composer-Setup.exe](https://getcomposer.org/Composer-Setup.exe)
```bash
curl -sS https://getcomposer.org/installer | php
```

2. 执行 Composer 命令安装 Alibaba Cloud Client for PHP 的最新稳定版本
```bash
php -d memory_limit=-1 composer.phar require alibabacloud/client
```
## 快速开始

3. 在代码中引入 Composer 自动加载工具
```php
<?php

require __DIR__ . '/vendor/autoload.php';
```
1. **阿里云帐户** - 在您开始之前,您需要注册阿里云帐户并获取您的[凭据](https://usercenter.console.aliyun.com/#/manage/ak)
1. **环境要求** - 您的系统需要满足[环境要求](docs/0-Requirements-CN.md)),包括 **PHP> = 5.5**。 我们强烈建议使用cURL扩展,并使用TLS后端编译cURL 7.16.2+。
1. **安装依赖** - 如果在您的系统上全局安装Composer,您可以在项目目录中运行以下内容,将 Alibaba Cloud Client for PHP 添加为依赖项:
```
composer require alibabacloud/client
```
请看 [安装](docs/1-Installation-CN.md) 有关通过 Composer 和其他方式安装的详细信息。


## 快速使用
Expand Down Expand Up @@ -129,6 +105,7 @@ try {


## 文档
* [环境要求](docs/0-Requirements-CN.md)
* [安装](docs/1-Installation-CN.md)
* [客户端](docs/2-Client-CN.md)
* [请求](docs/3-Request-CN.md)
Expand Down
44 changes: 11 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,20 @@ English | [简体中文](./README-CN.md)
**Alibaba Cloud Client for PHP** is a client tool that helps PHP developers manage credentials and send requests, [Alibaba Cloud SDK for PHP][SDK] dependency on this tool.


## Requirements
- You must use PHP 5.5.0 or later.
- if you use the `RsaKeyPair` (Only Japan station is supported) client, you will also need [OpenSSL PHP extension][OpenSSL].


## Online Demo
[API Explorer](https://api.aliyun.com) 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. **It is highly recommended**.


## Recommendations
- Use [Composer][composer] and optimize automatic loading `composer dump-autoload --optimize`
- Install [cURL][cURL] 7.16.2 or later version
- Use [OPCache][OPCache]
- In a production environment, do not use [Xdebug][xdebug]


## Installation
> To install Alibaba Cloud Client for PHP, you must know how to use [Composer][composer].
<br/>
[API Explorer](https://api.aliyun.com) 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.

1. Download and install Composer(Windows user please download and run [Composer-Setup.exe](https://getcomposer.org/Composer-Setup.exe))
```bash
curl -sS https://getcomposer.org/installer | php
```

2. Execute the Composer command, install the newest and stable version of Alibaba Cloud Client for PHP
```bash
php -d memory_limit=-1 composer.phar require alibabacloud/client
```
## Getting Started

3. Require the Composer auto-loading tool
```php
<?php

require __DIR__ . '/vendor/autoload.php';
```
1. **Alibaba Cloud Account** – Before you begin, you need to sign up for an Alibaba Cloud account and retrieve your [credentials](https://usercenter.console.aliyun.com/#/manage/ak).
1. **Requirements** – Your system will need to meet the [Requirements](docs/0-Requirements-EN.md), including having **PHP >= 5.5**. We highly recommend having it compiled with the cURL extension and cURL 7.16.2+.
1. **Install Dependency** – If Composer is installed globally on your system, you can run the following in the base directory of your project to add the Alibaba Cloud Client for PHP as a dependency:
```
composer require alibabacloud/client
```
Please see the
[Installation](docs/1-Installation-EN.md) for more detailed information about installing the Alibaba Cloud Client for PHP through Composer and other means.


## Quick Examples
Expand Down Expand Up @@ -128,6 +105,7 @@ try {


## Documentation
* [Requirements](docs/0-Requirements-EN.md)
* [Installation](docs/1-Installation-EN.md)
* [Client](docs/2-Client-EN.md)
* [Request](docs/3-Request-EN.md)
Expand Down
21 changes: 21 additions & 0 deletions docs/0-Requirements-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[← 首页](../README-CN.md) | 环境要求[(English)](0-Requirements-EN.md) | [安装 →](1-Installation-CN.md)
***

## 要求
- 您必须使用 PHP 5.5.0 或更高版本。
- 如果您使用了 `RsaKeyPair` 客户端(仅支持日本站),还需要 [OpenSSL PHP 扩展][OpenSSL]

## 建议
- 使用 [Composer][composer] 并优化自动加载 `composer dump-autoload --optimize`
- 安装 [cURL][cURL] 7.16.2 或更高版本
- 使用 [OPCache][OPCache]
- 生产环境中不要使用 [Xdebug][xdebug]

***
[← 首页](../README-CN.md) | 环境要求[(English)](0-Requirements-EN.md) | [安装 →](1-Installation-CN.md)

[composer]: https://getcomposer.org
[cURL]: http://php.net/manual/zh/book.curl.php
[OPCache]: http://php.net/manual/zh/book.opcache.php
[xdebug]: http://xdebug.org
[OpenSSL]: http://php.net/manual/zh/book.openssl.php
21 changes: 21 additions & 0 deletions docs/0-Requirements-EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[← Home](../README.md) | Requirements[(中文)](0-Requirements-CN.md) | [Installation →](1-Installation-EN.md)
***

## Requirements
- You must use PHP 5.5.0 or later.
- if you use the `RsaKeyPair` (Only Japan station is supported) client, you will also need [OpenSSL PHP extension][OpenSSL].

## Recommendations
- Use [Composer][composer] and optimize automatic loading `composer dump-autoload --optimize`
- Install [cURL][cURL] 7.16.2 or later version
- Use [OPCache][OPCache]
- In a production environment, do not use [Xdebug][xdebug]

***
[← Home](../README.md) | Requirements[(中文)](0-Requirements-CN.md) | [Installation →](1-Installation-EN.md)

[composer]: https://getcomposer.org
[cURL]: http://php.net/manual/en/book.curl.php
[OPCache]: http://php.net/manual/en/book.opcache.php
[xdebug]: http://xdebug.org
[OpenSSL]: http://php.net/manual/en/book.openssl.php
38 changes: 33 additions & 5 deletions docs/1-Installation-CN.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,51 @@
[首页](../README-CN.md) | 安装[(English)](1-Installation-EN.md) | [客户端 →](2-Client-CN.md)
[环境要求](0-Requirements-CN.md) | 安装[(English)](1-Installation-EN.md) | [客户端 →](2-Client-CN.md)
***

# 安装
1. 下载并安装 Composer(Windows 用户请下载并运行 [Composer-Setup.exe](https://getcomposer.org/Composer-Setup.exe)
安装 Alibaba Cloud Client for PHP 有如下方式:

- 通过 Composer 安装依赖
- 下载使用 ZIP 文件

在安装之前,请确保您的环境使用的是 PHP 5.5 或更高版本。了解有关[环境要求和建议的更多信息](0-Requirements-CN.md)

## 通过 Composer 安装依赖
通过 Composer 安装是推荐方式。Composer 是一款 PHP 工具,用于管理和安装项目的依赖项。有关如何安装 Composer、配置自动加载并遵循定义依赖关系的其他最佳实践的更多信息,请参阅 [getcomposer.org](https://getcomposer.org)

### 安装依赖
如果已在系统上[全局安装 Composer](https://getcomposer.org/doc/00-intro.md#globally),请直接在项目目录中运行以下内容来安装 Alibaba Cloud Client for PHP 作为依赖项:
```bash
composer require alibabacloud/client
```

否则,请下载并安装 Composer(Windows 用户请下载并运行 [Composer-Setup.exe](https://getcomposer.org/Composer-Setup.exe)
```bash
curl -sS https://getcomposer.org/installer | php
```

2. 执行 Composer 命令安装 Alibaba Cloud Client for PHP 的最新稳定版本
然后,执行 Composer 命令安装 Alibaba Cloud Client for PHP 作为依赖项
```bash
php -d memory_limit=-1 composer.phar require alibabacloud/client
```

3. 在代码中引入 Composer 自动加载工具
### 将自动加载工具添加到 PHP 脚本
要在脚本中使用 Alibaba Cloud Client for PHP,请在脚本中包含自动加载工具,如下所示。
```php
<?php

require __DIR__ . '/vendor/autoload.php';
```

## 下载使用 ZIP 文件
Alibaba Cloud Client for PHP 中的一个 ZIP 文件包含运行开发工具包所需的所有类和依赖项。

[下载 .zip 文件](http://aliyunsdk-pages.alicdn.com/php-sdk/client.zip),然后在项目中的选定位置进行解压缩。然后将自动加载工具包含到您的脚本中,如下所示。

```php
<?php

require __DIR__ . '/vendor/autoload.php';
```

***
[首页](../README-CN.md) | 安装[(English)](1-Installation-EN.md) | [客户端 →](2-Client-CN.md)
[环境要求](0-Requirements-CN.md) | 安装[(English)](1-Installation-EN.md) | [客户端 →](2-Client-CN.md)
38 changes: 33 additions & 5 deletions docs/1-Installation-EN.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,51 @@
[Home](../README.md) | Installation[(中文)](1-Installation-CN.md) | [Client →](2-Client-EN.md)
[Requirements](0-Requirements-EN.md) | Installation[(中文)](1-Installation-CN.md) | [Client →](2-Client-EN.md)
***

# Installation
1. Download and install Composer(Windows user please download and run [Composer-Setup.exe](https://getcomposer.org/Composer-Setup.exe))
There are ways to install Alibaba Cloud Client for PHP:

- As a dependency via Composer
- Installing by Using the ZIP file

Before you install ensure your environment is using PHP version 5.5 or later. Learn more about [environment requirements and recommendations](0-Requirements-EN.md).

## As a dependency via Compose
Composer is the recommended way to install. Composer is a tool for PHP that manages and installs the dependencies of your project. For more information on how to install Composer, configure autoloading, and follow other best practices for defining dependencies, see [getcomposer.org](https://getcomposer.org).

### Install
If Composer is already [installed globally on your system](https://getcomposer.org/doc/00-intro.md#globally), run the following in the base directory of your project to install Alibaba Cloud Client for PHP as a dependency:
```bash
composer require alibabacloud/client
```

Otherwise, download and install Composer (Windows users please download and run [Composer-Setup.exe](https://getcomposer.org/Composer-Setup.exe))
```bash
curl -sS https://getcomposer.org/installer | php
```

2. Execute the Composer command, install the newest and stable version of Alibaba Cloud Client for PHP
Then type this Composer command to install the latest version of the Alibaba Cloud Client for PHP as a dependency
```bash
php -d memory_limit=-1 composer.phar require alibabacloud/client
```

3. Require the Composer auto-loading tool
### Add autoloader to your PHP scripts
To utilize the Alibaba Cloud Client for PHP in your scripts, include the autoloader in your scripts, as follows.
```php
<?php

require __DIR__ . '/vendor/autoload.php';
```

## Installing by Using the ZIP file
The Alibaba Cloud Client for PHP includes a ZIP file containing all the classes and dependencies you need to run.

Download the [.zip file](http://aliyunsdk-pages.alicdn.com/php-sdk/client.zip), and then extract it into your project at a location you choose. Then include the autoloader in your scripts, as follows.

```php
<?php

require __DIR__ . '/vendor/autoload.php';
```

***
[Home](../README.md) | Installation[(中文)](1-Installation-CN.md) | [Client →](2-Client-EN.md)
[Requirements](0-Requirements-EN.md) | Installation[(中文)](1-Installation-CN.md) | [Client →](2-Client-EN.md)
2 changes: 1 addition & 1 deletion src/AlibabaCloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AlibabaCloud
/**
* Version of the Client
*/
const VERSION = '1.0.20';
const VERSION = '1.0.21';

/**
* This static method can directly call the specific service.
Expand Down

0 comments on commit e8d93d6

Please sign in to comment.