-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #240 from jemygraw/master
fix travis build error
- Loading branch information
Showing
13 changed files
with
269 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
require_once __DIR__ . '/../autoload.php'; | ||
|
||
use \Qiniu\Auth; | ||
|
||
$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
$secretKey = getenv('QINIU_SECRET_KEY'); | ||
$bucket = getenv('QINIU_TEST_BUCKET'); | ||
|
||
|
||
$auth = new Auth($accessKey, $secretKey); | ||
$config = new \Qiniu\Config(); | ||
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
|
||
//每次最多不能超过1000个 | ||
$keyMimePairs = array( | ||
'qiniu.mp4' => 'video/x-mp4', | ||
'qiniu.png' => 'image/x-png', | ||
'qiniu.jpg' => 'image/x-jpg' | ||
); | ||
|
||
$ops = $bucketManager->buildBatchChangeMime($bucket, $keyMimePairs); | ||
list($ret, $err) = $bucketManager->batch($ops); | ||
if ($err) { | ||
print_r($err); | ||
} else { | ||
print_r($ret); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
require_once __DIR__ . '/../autoload.php'; | ||
|
||
use \Qiniu\Auth; | ||
|
||
$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
$secretKey = getenv('QINIU_SECRET_KEY'); | ||
$bucket = getenv('QINIU_TEST_BUCKET'); | ||
|
||
|
||
$auth = new Auth($accessKey, $secretKey); | ||
$config = new \Qiniu\Config(); | ||
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
|
||
//每次最多不能超过1000个 | ||
$keys = array( | ||
'qiniu.mp4', | ||
'qiniu.png', | ||
'qiniu.jpg' | ||
); | ||
|
||
$keyTypePairs = array(); | ||
//type=0表示普通存储,type=1表示低频存储 | ||
foreach ($keys as $key) { | ||
$keyTypePairs[$key] = 1; | ||
} | ||
|
||
$ops = $bucketManager->buildBatchChangeType($bucket, $keyTypePairs); | ||
list($ret, $err) = $bucketManager->batch($ops); | ||
if ($err) { | ||
print_r($err); | ||
} else { | ||
print_r($ret); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
require_once __DIR__ . '/../autoload.php'; | ||
|
||
use \Qiniu\Auth; | ||
|
||
$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
$secretKey = getenv('QINIU_SECRET_KEY'); | ||
$bucket = getenv('QINIU_TEST_BUCKET'); | ||
|
||
|
||
$auth = new Auth($accessKey, $secretKey); | ||
$config = new \Qiniu\Config(); | ||
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
|
||
//每次最多不能超过1000个 | ||
$keys = array( | ||
'qiniu.mp4', | ||
'qiniu.png', | ||
'qiniu.jpg' | ||
); | ||
|
||
$keyPairs = array(); | ||
foreach ($keys as $key) { | ||
$keyPairs[$key] = $key . "_copy"; | ||
} | ||
|
||
$srcBucket = $bucket; | ||
$destBucket = $bucket; | ||
|
||
$ops = $bucketManager->buildBatchCopy($srcBucket, $keyPairs, $destBucket, true); | ||
list($ret, $err) = $bucketManager->batch($ops); | ||
if ($err) { | ||
print_r($err); | ||
} else { | ||
print_r($ret); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
require_once __DIR__ . '/../autoload.php'; | ||
|
||
use \Qiniu\Auth; | ||
|
||
$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
$secretKey = getenv('QINIU_SECRET_KEY'); | ||
$bucket = getenv('QINIU_TEST_BUCKET'); | ||
|
||
|
||
$auth = new Auth($accessKey, $secretKey); | ||
$config = new \Qiniu\Config(); | ||
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
|
||
//每次最多不能超过1000个 | ||
$keys = array( | ||
'qiniu.mp4', | ||
'qiniu.png', | ||
'qiniu.jpg' | ||
); | ||
|
||
$ops = $bucketManager->buildBatchDelete($bucket, $keys); | ||
list($ret, $err) = $bucketManager->batch($ops); | ||
if ($err) { | ||
print_r($err); | ||
} else { | ||
print_r($ret); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
require_once __DIR__ . '/../autoload.php'; | ||
|
||
use \Qiniu\Auth; | ||
|
||
$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
$secretKey = getenv('QINIU_SECRET_KEY'); | ||
$bucket = getenv('QINIU_TEST_BUCKET'); | ||
|
||
|
||
$auth = new Auth($accessKey, $secretKey); | ||
$config = new \Qiniu\Config(); | ||
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
|
||
//每次最多不能超过1000个 | ||
$keys = array( | ||
'qiniu.mp4', | ||
'qiniu.png', | ||
'qiniu.jpg' | ||
); | ||
|
||
$keyDayPairs = array(); | ||
//day=0表示永久存储 | ||
foreach ($keys as $key) { | ||
$keyDayPairs[$key] = 0; | ||
} | ||
|
||
$ops = $bucketManager->buildBatchDeleteAfterDays($bucket, $keyDayPairs); | ||
list($ret, $err) = $bucketManager->batch($ops); | ||
if ($err) { | ||
print_r($err); | ||
} else { | ||
print_r($ret); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
require_once __DIR__ . '/../autoload.php'; | ||
|
||
use \Qiniu\Auth; | ||
|
||
$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
$secretKey = getenv('QINIU_SECRET_KEY'); | ||
$bucket = getenv('QINIU_TEST_BUCKET'); | ||
|
||
|
||
$auth = new Auth($accessKey, $secretKey); | ||
$config = new \Qiniu\Config(); | ||
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
|
||
//每次最多不能超过1000个 | ||
$keys = array( | ||
'qiniu.mp4', | ||
'qiniu.png', | ||
'qiniu.jpg' | ||
); | ||
|
||
$keyPairs = array(); | ||
foreach ($keys as $key) { | ||
$keyPairs[$key . "_copy"] = $key . "_move"; | ||
} | ||
|
||
$srcBucket = $bucket; | ||
$destBucket = $bucket; | ||
|
||
$ops = $bucketManager->buildBatchMove($srcBucket, $keyPairs, $destBucket, true); | ||
list($ret, $err) = $bucketManager->batch($ops); | ||
if ($err) { | ||
print_r($err); | ||
} else { | ||
print_r($ret); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
require_once __DIR__ . '/../autoload.php'; | ||
|
||
use \Qiniu\Auth; | ||
|
||
$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
$secretKey = getenv('QINIU_SECRET_KEY'); | ||
$bucket = getenv('QINIU_TEST_BUCKET'); | ||
|
||
|
||
$auth = new Auth($accessKey, $secretKey); | ||
$config = new \Qiniu\Config(); | ||
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
|
||
//每次最多不能超过1000个 | ||
$keys = array( | ||
'qiniu.mp4', | ||
'qiniu.png', | ||
'qiniu.jpg' | ||
); | ||
|
||
$ops = $bucketManager->buildBatchStat($bucket, $keys); | ||
list($ret, $err) = $bucketManager->batch($ops); | ||
if ($err) { | ||
print_r($err); | ||
} else { | ||
print_r($ret); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
require_once __DIR__ . '/../autoload.php'; | ||
|
||
use \Qiniu\Auth; | ||
|
||
$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
$secretKey = getenv('QINIU_SECRET_KEY'); | ||
$bucket = getenv('QINIU_TEST_BUCKET'); | ||
|
||
$key = "qiniu.mp4"; | ||
$auth = new Auth($accessKey, $secretKey); | ||
$config = new \Qiniu\Config(); | ||
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
$err = $bucketManager->prefetch($bucket, $key); | ||
if ($err) { | ||
print_r($err); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.