Skip to content

Commit 28788e6

Browse files
committed
doc: update api doc
add getMimetype
1 parent 5d1135c commit 28788e6

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

doc.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* [read](#read) 读取云存储文件/目录内容
1313
* [has](#has) 判断文件是否存在于又拍云存储
1414
* [info](#info) 获取云存储文件/目录的基本信息
15+
* [getMimetype](#getMimetype) 获取云存储文件类型
1516
* [delete](#delete) 删除文件或者目录
1617
* [createDir](#createdir) 创建目录
1718
* [deleteDir](#deletedir) 删除文件或者目录
@@ -184,7 +185,7 @@ Upyun::has( string $path )
184185
获取云存储文件/目录的基本信息
185186

186187
```php
187-
Upyun::info( string $path )
188+
Upyun::info( string $path, array $otherHeaders)
188189
```
189190

190191

@@ -196,16 +197,44 @@ Upyun::info( string $path )
196197
- **string** `$path`
197198
云存储的文件路径
198199

200+
- **string** `$otherHeaders`
201+
设置了后,方法将返回其他 http header 中的信息,默认为空
199202

200203
**返回值:**
201204

202-
返回一个数组,包含以下 key
205+
返回一个数组,默认包含以下 key
203206
- `x-upyun-file-type` 当 $path 是目录时,值为 *folder*,当 $path 是文件时,值为 *file*
204207
- `x-upyun-file-size` 文件大小
205208
- `x-upyun-file-date` 文件的创建时间
206209

207210

208211

212+
---
213+
214+
### getMimetype
215+
216+
获取云存储文件的文档类型
217+
218+
```php
219+
Upyun::getMimetype( string $path )
220+
```
221+
222+
223+
224+
225+
**参数列表:**
226+
227+
228+
- **string** `$path`
229+
云存储的文件路径
230+
231+
232+
**返回值:**
233+
234+
文档类型,e.g: `appcation/json`,获取失败返回空字符串
235+
236+
237+
209238
---
210239

211240

src/Upyun/Upyun.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public function has($path)
173173
* @param string $path 云存储的文件路径
174174
* @param array $otherHeaders 设置了后,方法将返回其他 http header 中的信息,默认为空
175175
*
176-
* @return array 返回一个数组,包含以下 key
176+
* @return array 返回一个数组,默认包含以下 key
177177
* - `x-upyun-file-type` 当 $path 是目录时,值为 *folder*,当 $path 是文件时,值为 *file*,
178178
* - `x-upyun-file-size` 文件大小
179179
* - `x-upyun-file-date` 文件的创建时间
@@ -189,7 +189,7 @@ public function info($path, $otherHeaders = array())
189189
/**
190190
* 获取文件的文档类型
191191
* @param string $path 云存储文件路径
192-
* @return string 文档类型,获取失败返回空字符串
192+
* @return string 文档类型,e.g: `appcation/json`,获取失败返回空字符串
193193
*/
194194
public function getMimetype($path)
195195
{

0 commit comments

Comments
 (0)