Beispiel #1
0
 public function testExifPrivate()
 {
     global $testAuth;
     $fop = new Operation('private-res.qiniudn.com', $testAuth);
     list($exif, $error) = $fop->exif('noexif.jpg');
     $this->assertNotNull($error);
     $this->assertNull($exif);
 }
Beispiel #2
0
 public function testbuildUrl()
 {
     $fops = 'imageView2/2/h/200';
     $fop = new Operation('testres.qiniudn.com');
     $url = $fop->buildUrl('gogopher.jpg', $fops);
     $this->assertEquals($url, 'http://testres.qiniudn.com/gogopher.jpg?imageView2/2/h/200');
     $fops = array('imageView2/2/h/200', 'imageInfo');
     $url = $fop->buildUrl('gogopher.jpg', $fops);
     $this->assertEquals($url, 'http://testres.qiniudn.com/gogopher.jpg?imageView2/2/h/200|imageInfo');
 }
Beispiel #3
0
 public function testExecute2()
 {
     global $testAuth;
     $pfop = new PersistentFop($testAuth, 'testres', 'sdktest', true);
     $url_src1 = 'http://testres.qiniudn.com/gogopher.jpg';
     $url_en1 = \Qiniu\base64_urlSafeEncode($url_src1);
     $url_alias_en1 = \Qiniu\base64_urlSafeEncode('g.jpg');
     $url_en2 = $url_en1;
     $fop = "mkzip/2/url/{$url_en1}/alias/{$url_alias_en1}/url/{$url_en2}";
     $op = Operation::saveas($fop, 'phpsdk', 'mkziptest');
     $ops = array();
     array_push($ops, $op);
     list($id, $error) = $pfop->execute('sintel_trailer.mp4', $ops);
     $this->assertNull($error);
     list($status, $error) = PersistentFop::status($id);
     $this->assertNotNull($status);
     $this->assertNull($error);
 }
Beispiel #4
0
 public function mkzip($dummy_key, $urls_and_alias, $to_bucket = null, $to_key = null, $mode = 2)
 {
     $base = 'mkzip/' . $mode;
     $op = array($base);
     foreach ($urls_and_alias as $key => $value) {
         if (is_int($key)) {
             array_push($op, 'url/' . \Qiniu\base64_urlSafeEncode($value));
         } else {
             array_push($op, 'url/' . \Qiniu\base64_urlSafeEncode($key));
             array_push($op, 'alias/' . \Qiniu\base64_urlSafeEncode($key));
         }
     }
     $fop = implode('/', $op);
     if ($to_bucket != null) {
         $op = Operation::saveas($fop, $to_bucket, $to_key);
     }
     $ops = array($op);
     return $this->execute($dummy_key, $ops);
 }