Skip to content

Commit 87fcf73

Browse files
committed
feat remove multi upload api
1 parent 695367c commit 87fcf73

File tree

6 files changed

+0
-226
lines changed

6 files changed

+0
-226
lines changed

phpunit.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<testsuite name="upyun test cases">
1313
<file>./tests/SignatureTest.php</file>
1414
<file>./tests/UpyunTest.php</file>
15-
<file>./tests/Api/MultiTest.php</file>
1615
</testsuite>
1716
</testsuites>
1817
</phpunit>

src/Upyun/Api/Multi.php

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

src/Upyun/Config.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@ class Config
3636
* @var int 上传的接口类型设置为 `AUTO` 时,文件大小的边界值:小于该值时,使用 rest api,否则使用断点续传。 默认 30M
3737
*/
3838
public $sizeBoundary = 31457280;
39-
/**
40-
* @var int 分块上传`Multi`接口的最大分块值
41-
*/
42-
public $maxBlockSize = 5242880;
43-
44-
/**
45-
* @var int 分块时,每个块的过期时间
46-
*/
47-
public $blockExpiration = 60;
4839

4940
/**
5041
* @var int request timeout seconds

src/Upyun/Signature.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -95,31 +95,4 @@ public static function getBodySignature(Config $bucketConfig, $method, $uri, $da
9595
$signature = base64_encode(hash_hmac('sha1', implode('&', $data), $bucketConfig->operatorPassword, true));
9696
return 'UPYUN ' . $bucketConfig->operatorName . ':' . $signature;
9797
}
98-
99-
public static function getSignature(Config $bucketConfig, $data, $type, $tokenSecret = '')
100-
{
101-
if (is_array($data)) {
102-
ksort($data);
103-
$string = '';
104-
foreach ($data as $k => $v) {
105-
if (is_array($v)) {
106-
$v = implode('', $v);
107-
}
108-
$string .= "$k$v";
109-
}
110-
switch ($type) {
111-
case self::SIGN_MULTIPART:
112-
$string .= $tokenSecret ? $tokenSecret : $bucketConfig->getFormApiKey();
113-
break;
114-
case self::SIGN_VIDEO:
115-
$string = $bucketConfig->operatorName . $string . $bucketConfig->operatorPassword;
116-
break;
117-
case self::SIGN_VIDEO_NO_OPERATOR:
118-
break;
119-
}
120-
$sign = md5($string);
121-
return $sign;
122-
}
123-
return false;
124-
}
12598
}

tests/Api/MultiTest.php

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

tests/SignatureTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ public function setUp()
1717
$this->config = new Config('bucket', 'operator', 'password');
1818
}
1919

20-
public function testGetSignature()
21-
{
22-
$sign = Signature::getSignature($this->config, array('a' => 'a', 'b' => 'b'), Signature::SIGN_MULTIPART, '123');
23-
$this->assertEquals($sign, '2aa0afd612df8fab4b3fded36c396234');
24-
}
25-
2620
public function testGetBodySignature()
2721
{
2822
$sign = Signature::getBodySignature($this->config, 'POST', '/bucket');

0 commit comments

Comments
 (0)