Skip to content

Commit 9944a01

Browse files
committed
move demo to demo directory
1 parent 1dd432a commit 9944a01

File tree

14 files changed

+79
-144
lines changed

14 files changed

+79
-144
lines changed

1.mp4

-11.8 MB
Binary file not shown.

demo/fetch.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
require_once('../qiniu/rs.php');
4+
require_once('../qiniu/conf.php');
5+
6+
$client = new Qiniu_MacHttpClient(null);
7+
$ret = Qiniu_RS_Fetch($client, 'http://rwxf.qiniucdn.com/1.jpg', 'rwxf', 'qiniu.jpg');
8+
9+
var_dump($ret);
10+
11+

demo/pfop.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
require_once('../qiniu/pfop.php');
3+
require_once('../qiniu/http.php');
4+
5+
$client = new Qiniu_MacHttpClient(null);
6+
7+
$pfop = new Qiniu_Pfop();
8+
9+
$pfop->Bucket = 'rwxf';
10+
$pfop->Key = '1.mp4';
11+
12+
$savedKey = 'qiniu.jpg';
13+
$entry = Qiniu_Encode("$pfop->Bucket:$savedKey");
14+
$pfop->Fops = "vframe/jpg/offset/180/w/1000/h/1000/rotate/90|saveas/$entry";
15+
16+
list($ret, $err) = $pfop->MakeRequest($client);
17+
echo "\n\n====> pfop result: \n";
18+
if ($err !== null) {
19+
var_dump($err);
20+
} else {
21+
var_dump($ret);
22+
}

demo/sign_req.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<?php
2+
require_once('../qiniu/auth_digest.php');
3+
require('../qiniu/http.php');
24

3-
require_once("../qiniu/auth_digest.php");
4-
require("../qiniu/http.php");
5-
6-
$url = 'https://10fd05306325.a.passageway.io';
5+
$url = 'https://10fd05306325.a.passageway.io/chgm/aXRpc2F0ZXN0OmdvZ29waGVyLmpwZw==/mime/YXBwbGljYXRpb24vdGVzdA==';
76
$u = array('path' => $url);
8-
$req = new Qiniu_Request($u, 'name=123.txt&hash=FkU6TEApsSV89zqQ4_Lr9IWCsdP2&size=7&key=201409030000019228_doc_1410847521821&catalog_type=P');
9-
10-
7+
$req = new Qiniu_Request($u, '');
118
$mac = Qiniu_RequireMac(null);
129

1310
echo $mac->SignRequest($req, true);

demo/up.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
require_once('../qiniu/io.php');
4+
require_once('../qiniu/rs.php');
5+
6+
$bucket = 'rwxf';
7+
$key = 'up.php';
8+
$file = __FILE__;
9+
10+
11+
$client = new Qiniu_MacHttpClient(null);
12+
$putPolicy = new Qiniu_RS_PutPolicy($bucket);
13+
$putPolicy->Scope = "$bucket:$key";
14+
$putPolicy->CallbackUrl = 'https://10fd05306325.a.passageway.io';
15+
$putPolicy->CallbackBody = 'key=$(key)&hash=$(etag)';
16+
$upToken = $putPolicy->Token(null);
17+
18+
$putExtra = new Qiniu_PutExtra();
19+
$putExtra->Crc32 = 1;
20+
$s = time();
21+
list($ret, $err) = Qiniu_PutFile($upToken, $key, $file, $putExtra);
22+
echo "time elapse:". (time() - $s) . "\n";
23+
echo "\n\n====> Qiniu_PutFile result: \n";
24+
if ($err !== null) {
25+
var_dump($err);
26+
} else {
27+
var_dump($ret);
28+
}
29+

encode.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

fetch.php

Lines changed: 0 additions & 10 deletions
This file was deleted.

pfop_demo.php

Lines changed: 0 additions & 26 deletions
This file was deleted.

pfop_query.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

qiniu/conf.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
$QINIU_API_HOST = 'http://api.qiniu.com';
1717
$QINIU_IOVIP_HOST = 'http://iovip.qbox.me';
1818

19-
$QINIU_ACCESS_KEY = '<Please apply your access key>';
20-
$QINIU_SECRET_KEY = '<Dont send your secret key to anyone>';
19+
// $QINIU_ACCESS_KEY = '<Please apply your access key>';
20+
// $QINIU_SECRET_KEY = '<Dont send your secret key to anyone>';
21+
22+
23+
$QINIU_ACCESS_KEY = 'Vhiv6a22kVN_zhtetbPNeG9sY3JUL1HG597EmBwQ';
24+
$QINIU_SECRET_KEY = 'b5b5vNg5nnkwkPfW5ayicPE_pj6hqgKMQEaWQ6JD';
2125

0 commit comments

Comments
 (0)