初始化仓库
This commit is contained in:
64
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/PicOperationsTransformation.php
vendored
Normal file
64
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/PicOperationsTransformation.php
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Qcloud\Cos\ImageParamTemplate;
|
||||
|
||||
/**
|
||||
* Class PicOperationsTransformation 图片处理参数 Pic-Operations
|
||||
* @package Qcloud\Cos\ImageParamTemplate
|
||||
*/
|
||||
class PicOperationsTransformation {
|
||||
private $isPicInfo;
|
||||
private $rules;
|
||||
|
||||
public function __construct() {
|
||||
$this->isPicInfo = 0;
|
||||
$this->rules = array();
|
||||
}
|
||||
|
||||
public function setIsPicInfo($value) {
|
||||
$this->isPicInfo = $value;
|
||||
}
|
||||
|
||||
public function addRule(ImageTemplate $template, $fileid = "", $bucket = "") {
|
||||
$rule = $template->queryString();
|
||||
if($rule){
|
||||
$item = array();
|
||||
$item['rule'] = $rule;
|
||||
if($fileid){
|
||||
$item['fileid'] = $fileid;
|
||||
}
|
||||
if($bucket) {
|
||||
$item['bucket'] = $bucket;
|
||||
}
|
||||
$this->rules[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
public function getIsPicInfo() {
|
||||
return $this->isPicInfo;
|
||||
}
|
||||
|
||||
public function getRules() {
|
||||
return $this->rules;
|
||||
}
|
||||
|
||||
public function queryString() {
|
||||
$res = "";
|
||||
$picOperations = array();
|
||||
if($this->isPicInfo){
|
||||
$picOperations['is_pic_info'] = $this->isPicInfo;
|
||||
}
|
||||
if($this->rules){
|
||||
$picOperations['rules'] = $this->rules;
|
||||
}
|
||||
if($picOperations){
|
||||
$res = json_encode($picOperations);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function resetRule() {
|
||||
$this->isPicInfo = 0;
|
||||
$this->rules = array();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user