Skip to content

Commit ee6aea1

Browse files
committed
修正PHP5.2.x版本下导致fatal error的问题
1 parent 7a6cf5c commit ee6aea1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

upyun.class.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<?php
22

33
class UpYunException extends Exception {/*{{{*/
4+
public function __construct($message, $code, Exception $previous = null) {
5+
parent::__construct($message, $code); // For PHP 5.2.x
6+
}
7+
48
public function __toString() {
59
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
610
}
@@ -81,8 +85,8 @@ class UpYun {
8185
/**
8286
* 初始化 UpYun 存储接口
8387
* @param $bucketname 空间名称
84-
* @param $username 操作员账号
85-
* @param $password 操作员密码
88+
* @param $username 操作员名称
89+
* @param $password 密码
8690
*
8791
* @return object
8892
*/
@@ -456,7 +460,7 @@ public function getBucketUsage() {/*{{{*/
456460
* 切换 API 接口的域名
457461
*
458462
* @deprecated
459-
* @param $domain {默认 v0.api.upyun.com 自动识别, v1.api.upyun.com 电信, v2.api.upyun.com 联通网通, v3.api.upyun.com 移动铁通}
463+
* @param $domain {默然 v0.api.upyun.com 自动识别, v1.api.upyun.com 电信, v2.api.upyun.com 联通, v3.api.upyun.com 移动}
460464
* return null;
461465
*/
462466
public function setApiDomain($domain){/*{{{*/
@@ -475,7 +479,7 @@ public function setContentMD5($str){/*{{{*/
475479
}/*}}}*/
476480

477481
/**
478-
* 设置待上传文件的 访问密钥(注意:仅支持图片空间!,设置密钥后,无法根据原文件URL直接访问,需带 URL 后面加上 (缩略图间隔标志符+密钥) 进行访问)
482+
* 设置待上传文件的 访问密钥(注意:仅支持图片空!,设置密钥后,无法根据原文件URL直接访问,需带 URL 后面加上 (缩略图间隔标志符+密钥) 进行访问)
479483
* 如缩略图间隔标志符为 ! ,密钥为 bac,上传文件路径为 /folder/test.jpg ,那么该图片的对外访问地址为: http://空间域名/folder/test.jpg!bac
480484
*
481485
* @deprecated

0 commit comments

Comments
 (0)