CIProcessTransformation.php 791 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Qcloud\Cos\ImageParamTemplate;
  3. class CIProcessTransformation extends ImageTemplate{
  4. private $tranParams = array();
  5. private $tranString;
  6. public function __construct($ciProcess) {
  7. parent::__construct();
  8. $this->tranParams['ci-process'] = $ciProcess;
  9. $this->tranString = "";
  10. }
  11. public function addParam($name, $value, $base64 = false) {
  12. if(is_string($name) && strlen($name) > 0){
  13. if($base64) {
  14. $value = $this->ciBase64($value);
  15. }
  16. $this->tranParams[$name] = $value;
  17. }
  18. }
  19. public function queryString() {
  20. if($this->tranParams) {
  21. $this->tranString = http_build_query($this->tranParams);
  22. }
  23. return $this->tranString;
  24. }
  25. }