Skip to content

Commit

Permalink
prerelease 2.3.2 (#229)
Browse files Browse the repository at this point in the history
* feat(*):添加新特性,修复bug
- 视频截帧,视频信息查询,put/get bucket referer
- CRC添加
- 修复默认分块过大导致上传失败的问题
- 修复图片鉴定ci-process param出现两次的bug
- 依赖更新
- action添加
  • Loading branch information
tuuna authored Sep 16, 2021
1 parent 7d30c55 commit 98168d1
Show file tree
Hide file tree
Showing 23 changed files with 1,214 additions and 79 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml export-ignore
/src/Qcloud/Cos/Tests export-ignore
/bin export-ignore
34 changes: 34 additions & 0 deletions .github/workflows/php5.6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PHP 5.6
on:
push:
branches:
- master
pull_request:
branches:
- master

env:
COS_REGION: ${{ secrets.COS_REGION }}
COS_APPID: ${{ secrets.COS_APPID }}
COS_SECRET: ${{ secrets.COS_SECRET }}
COS_KEY: ${{ secrets.COS_KEY }}
COS_BUCKET: ${{ secrets.COS_BUCKET }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: php:5.6
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare
run: |
apt update
apt install -y libzip-dev unzip
docker-php-ext-install zip
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
composer install
- name: Test
run: for i in `ls src/Qcloud/Cos/*.php`; do php -l $i; done
36 changes: 36 additions & 0 deletions .github/workflows/php7.1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PHP 7.1
on:
push:
branches:
- master
pull_request:
branches:
- master

env:
COS_REGION: ${{ secrets.COS_REGION }}
COS_APPID: ${{ secrets.COS_APPID }}
COS_SECRET: ${{ secrets.COS_SECRET }}
COS_KEY: ${{ secrets.COS_KEY }}
COS_BUCKET: ${{ secrets.COS_BUCKET }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: php:7.1
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test
run: |
apt update
apt install -y libzip-dev unzip
docker-php-ext-install zip
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
composer install
composer require --dev phpunit/phpunit
./vendor/bin/phpunit
- name: codecov
uses: codecov/codecov-action@v2
38 changes: 38 additions & 0 deletions .github/workflows/php7.2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PHP 7.2
on:
push:
branches:
- master
pull_request:
branches:
- master

env:
COS_REGION: ${{ secrets.COS_REGION }}
COS_APPID: ${{ secrets.COS_APPID }}
COS_SECRET: ${{ secrets.COS_SECRET }}
COS_KEY: ${{ secrets.COS_KEY }}
COS_BUCKET: ${{ secrets.COS_BUCKET }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: php:7.2
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test
run: |
apt update
apt install -y libzip-dev unzip
docker-php-ext-install zip
pecl install xdebug
docker-php-ext-enable xdebug
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
composer install
composer require --dev phpunit/phpunit
XDEBUG_MODE=coverage ./vendor/bin/phpunit
- name: codecov
uses: codecov/codecov-action@v2
38 changes: 38 additions & 0 deletions .github/workflows/php7.3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PHP 7.3
on:
push:
branches:
- master
pull_request:
branches:
- master

env:
COS_REGION: ${{ secrets.COS_REGION }}
COS_APPID: ${{ secrets.COS_APPID }}
COS_SECRET: ${{ secrets.COS_SECRET }}
COS_KEY: ${{ secrets.COS_KEY }}
COS_BUCKET: ${{ secrets.COS_BUCKET }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: php:7.3
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test
run: |
apt update
apt install -y libzip-dev unzip
docker-php-ext-install zip
pecl install xdebug
docker-php-ext-enable xdebug
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
composer install
composer require --dev phpunit/phpunit
XDEBUG_MODE=coverage ./vendor/bin/phpunit
- name: codecov
uses: codecov/codecov-action@v2
37 changes: 37 additions & 0 deletions .github/workflows/php7.4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PHP 7.4
on:
push:
branches:
- master
pull_request:
branches:
- master

env:
COS_REGION: ${{ secrets.COS_REGION }}
COS_APPID: ${{ secrets.COS_APPID }}
COS_SECRET: ${{ secrets.COS_SECRET }}
COS_KEY: ${{ secrets.COS_KEY }}
COS_BUCKET: ${{ secrets.COS_BUCKET }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: php:7.4
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare
run: |
apt update
apt install -y libzip-dev unzip
docker-php-ext-install zip
pecl install xdebug
docker-php-ext-enable xdebug
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
composer require --dev phpunit/phpunit
- name: Test
run: |
XDEBUG_MODE=coverage ./vendor/bin/phpunit
39 changes: 39 additions & 0 deletions .github/workflows/php8.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PHP 8.0
on:
push:
branches:
- master
pull_request:
branches:
- master

env:
COS_REGION: ${{ secrets.COS_REGION }}
COS_APPID: ${{ secrets.COS_APPID }}
COS_SECRET: ${{ secrets.COS_SECRET }}
COS_KEY: ${{ secrets.COS_KEY }}
COS_BUCKET: ${{ secrets.COS_BUCKET }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: php:8.0
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare
run: |
apt update
apt install -y libzip-dev unzip
docker-php-ext-install zip
pecl install xdebug
docker-php-ext-enable xdebug
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
composer require --dev phpunit/phpunit
- name: Test
run: |
XDEBUG_MODE=coverage ./vendor/bin/phpunit
- name: codecov
uses: codecov/codecov-action@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ composer.lock
vendor/
*.DS_Store
index.php
clover.xml
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
cos-php-sdk-v5 Upgrade Guide
====================

2.3.1 to 2.3.2
---------
- 新增视频截帧,视频信息查询示例
- 新增PUT/GET Bucket Referer示例
- 对于相应接口添加CRC返回信息
- 修复图片审核中ci-process param出现两次的问题
- 修复PHP5.6 版本的依赖问题
- 根据PHP版本自动composer install guzzle6.x或guzzle7

2.3.0 to 2.3.1
---------
- 修复文本检测的返回格式
- 修复sample中的问题
- 新增视频、文本、文档、音频检测
- 新增媒体转码、截图、拼接

2.2.3 to 2.3.0
---------
- 新增图片审核,视频审核,音频审核,文本审核,文档审核接口
Expand Down
2 changes: 1 addition & 1 deletion bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Usage: php bin/release or php bin/release version
*/

require_once 'vendor/autoload.php';
require_once '../vendor/autoload.php';

use Qcloud\Cos\Client;
use Qcloud\Cos\Service;
Expand Down
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@
"files": ["src/Qcloud/Cos/Common.php"]
},
"require": {
"php": ">=5.3.0",
"guzzlehttp/guzzle": "~6.3",
"guzzlehttp/guzzle-services": "~1.1"
"php": ">=5.6",
"guzzlehttp/guzzle": ">=6.2.1",
"guzzlehttp/guzzle-services": ">=1.1",
"guzzlehttp/psr7": "<2.0"
},
"config": {
"platform-check": false
}
}
2 changes: 1 addition & 1 deletion sample/copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$result = $cosClient->copy(
$bucket = 'examplebucket-125000000', //格式:BucketName-APPID
$key = 'exampleobject',
$copySorce = array(
$copySource = array(
'Region' => '<sourceRegion>',
'Bucket' => '<sourceBucket>',
'Key' => '<sourceKey>',
Expand Down
25 changes: 25 additions & 0 deletions sample/getBucketReferer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

require dirname(__FILE__) . '/../vendor/autoload.php';

$secretId = "SECRETID"; //"云 API 密钥 SecretId";
$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey";
$region = "ap-beijing"; //设置一个默认的存储桶地域
$cosClient = new Qcloud\Cos\Client(
array(
'region' => $region,
'schema' => 'https', //协议头部,默认为http
'credentials' => array(
'secretId' => $secretId,
'secretKey' => $secretKey)));
try {
$result = $cosClient->getBucketReferer(array(
'Bucket' => 'examplebucket-125000000' //格式:BucketName-APPID
)
);
// 请求成功
echo($result);
} catch (\Exception $e) {
// 请求失败
echo($e);
}
29 changes: 29 additions & 0 deletions sample/getMediaInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

require dirname(__FILE__) . '/../vendor/autoload.php';

$secretId = "SECRETID"; //"云 API 密钥 SecretId";
$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey";
$region = "ap-beijing"; //设置一个默认的存储桶地域
$cosClient = new Qcloud\Cos\Client(
array(
'region' => $region,
'schema' => 'https', //协议头部,默认为http
'credentials'=> array(
'secretId' => $secretId ,
'secretKey' => $secretKey)));

try {
$result = $cosClient->GetMediaInfo(
array(
'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
'Key' =>'exampleobject', //桶中的媒体文件,如test.mp4
'ci-process' => 'videoinfo' //操作类型,固定使用 videoinfo
)
);
// 请求成功
echo($result);
} catch (\Exception $e) {
// 请求失败
echo($e);
}
4 changes: 3 additions & 1 deletion sample/getObjectSensitiveContentRecognition.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
$result = $cosClient->getObjectSensitiveContentRecognition(array(
'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
'Key' => 'exampleobject',
'DetectType' => 'porn,politics' //可选四种参数:porn,politics,terrorist,ads,可使用多种规则,注意规则间不要加空格
'DetectType' => 'porn,politics', //可选四种参数:porn,politics,terrorist,ads,可使用多种规则,注意规则间不要加空格
'ci-process' => 'sensitive-content-recognition',
// 'Interval' => 5, // 审核gif时使用 截帧的间隔
// 'MaxFrames' => 5, // 针对 GIF 动图审核的最大截帧数量,需大于0。
// 'BizType' => '', // 审核策略
Expand All @@ -33,6 +34,7 @@
'Key' => '/', // 链接图片资源路径写 / 即可
'DetectType' => 'porn,ads',//可选四种参数:porn,politics,terrorist,ads,可使用多种规则,注意规则间不要加空格
'DetectUrl' => $imgUrl,
'ci-process' => 'sensitive-content-recognition',
// 'Interval' => 5, // 审核gif时使用 截帧的间隔
// 'MaxFrames' => 5, // 针对 GIF 动图审核的最大截帧数量,需大于0。
// 'BizType' => '', // 审核策略
Expand Down
Loading

0 comments on commit 98168d1

Please sign in to comment.