Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 预处理接口调用失败 #36

Merged
merged 1 commit into from
Aug 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,11 @@ Upyun::process( string $source, array $tasks )
```

该方法是基于[又拍云云处理](http://docs.upyun.com/cloud/) 服务实现,可以实现音视频的转码、切片、剪辑;文件的压缩解压缩;文件拉取功能
所有需要调用该方法处理的资源,必须已经上传到云存储服务,未上传到云存储的文件,同时需要云处理功能,请使用 `write` 方法。

注意:
- 所有需要调用该方法处理的资源,必须已经上传到云存储服务
- 使用 `process` 之前,必须配置 `config->processNotifyUrl`,否则会提交任务失败

例如视频转码:
```
process($source, array(
Expand Down
5 changes: 4 additions & 1 deletion src/Upyun/Api/Pretreat.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class Pretreat

public function __construct(Config $config)
{
if (!$config->processNotifyUrl) {
throw new \Exception("should config prosessNotifyUrl first.");
}
$this->config = $config;
}

Expand All @@ -29,7 +32,7 @@ public function process($source, $tasks)
]);

$params = array(
'bucket_name' => $this->config->bucketName,
'service' => $this->config->bucketName,
'notify_url' => $this->config->processNotifyUrl,
'source' => $source,
'tasks' => $encodedTasks,
Expand Down
7 changes: 5 additions & 2 deletions src/Upyun/Upyun.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,11 @@ public function purge($urls)
* 异步云处理
*
* 该方法是基于[又拍云云处理](http://docs.upyun.com/cloud/) 服务实现,可以实现音视频的转码、切片、剪辑;文件的压缩解压缩;文件拉取功能
* 所有需要调用该方法处理的资源,必须已经上传到云存储服务,未上传到云存储的文件,同时需要云处理功能,请使用 `write` 方法。
*
* 注意:
* - 所有需要调用该方法处理的资源,必须已经上传到云存储服务
* - 使用 `process` 之前,必须配置 `config->processNotifyUrl`,否则会提交任务失败
*
* 例如视频转码:
* ```
* process($source, array(
Expand All @@ -309,7 +313,6 @@ public function purge($urls)
* ... // 同时还可以添加其他任务
* ))
* ```
* 注意,被处理的资源需要已经上传到又拍云云存储
*
* @param string $source 需要预处理的图片、音视频资源在又拍云存储的路径
* @param array $tasks 需要处理的任务
Expand Down