We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae52f18 commit 56c3e4bCopy full SHA for 56c3e4b
demos/fetch.php
@@ -0,0 +1,25 @@
1
+<?php
2
+require_once '../vendor/autoload.php';
3
+
4
+use Qiniu\Auth;
5
+use Qiniu\Storage\BucketManager;
6
7
+$accessKey = 'XI0n2kV1LYwzcxqSZQxJ7bpycxDIAXFGJMWUt_zG';
8
+$secretKey = '9WTmIAiwKQ2Nq6o93mfKd6VQqq56HjjLZonMWLJl';
9
10
+$auth = new Auth($accessKey, $secretKey);
11
+$bmgr = new BucketManager($auth);
12
13
+$url = 'http://php.net/favicon.ico';
14
+$bucket = 'rwxf';
15
+$key = time() . '.ico';
16
17
+list($ret, $err) = $bmgr->fetch($url, $bucket, $key);
18
+echo "fetch $url to bucket: $bucket key: $key\n";
19
+if ($err !== null)
20
+{
21
+ var_dump($err);
22
+} else {
23
+ var_dump($ret);
24
+}
25
0 commit comments