ImgURL是一个简单、纯粹的图床程序,让个人图床多一个选择。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

36 lines
684 B

<?php
namespace Tinify;
class Result extends ResultMeta {
protected $data;
public function __construct($meta, $data) {
$this->meta = $meta;
$this->data = $data;
}
public function data() {
return $this->data;
}
public function toBuffer() {
return $this->data;
}
public function toFile($path) {
return file_put_contents($path, $this->toBuffer());
}
public function size() {
return intval($this->meta["content-length"]);
}
public function mediaType() {
return $this->meta["content-type"];
}
public function contentType() {
return $this->mediaType();
}
}