Skip to content

Commit c695f00

Browse files
committed
Merge pull request #161 from sinkcup/fetch-no-key
resolved #159
2 parents 49bfbed + a2594fe commit c695f00

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Qiniu/Storage/BucketManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function changeMime($bucket, $key, $mime)
208208
* ]
209209
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/fetch.html
210210
*/
211-
public function fetch($url, $bucket, $key)
211+
public function fetch($url, $bucket, $key = null)
212212
{
213213

214214
$resource = \Qiniu\base64_urlSafeEncode($url);

tests/Qiniu/Tests/BucketTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ public function testFetch()
131131
);
132132
$this->assertArrayHasKey('key', $ret);
133133
$this->assertNull($error);
134+
135+
list($ret, $error) = $this->bucketManager->fetch(
136+
'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html',
137+
$this->bucketName
138+
);
139+
$this->assertArrayHasKey('key', $ret);
140+
$this->assertNull($error);
134141
}
135142

136143
public function testBatchCopy()

0 commit comments

Comments
 (0)