/** * 解析服务器返回的json response * @param array $fops * @return array */ public function jsonResponse(array $fops) { $url = $this->bucket->makeURL($this->key(), $fops); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 10); $content = curl_exec($ch); curl_close($ch); return json_decode($content, true); }
public function testBucket() { QiniuBucket::setDomain('test'); $url = QiniuBucket::makeURL('some_file', [$this->imageView2(), $this->imageMogr2()]); $this->assertEquals($url, 'http://test.qiniudn.com/some_file?imageView2/2/w/200/h/100/q/85/format/jpg/interlace/1|imageMogr2/auto-orient/strip/thumbnail/300x200>/gravity/NorthEast/crop/!100x150-2a3/quality/90/blur/20x3/format/jpg/interlace/1/rotate/90'); }