1 | <?php |
||
10 | class Ucpaas |
||
|
|||
11 | { |
||
12 | /** |
||
13 | * 云之讯REST API版本号。当前版本号为:2014-06-30 |
||
14 | */ |
||
15 | const SoftVersion = '2014-06-30'; |
||
16 | /** |
||
17 | * API请求地址 |
||
18 | */ |
||
19 | const BaseUrl = 'https://api.ucpaas.com/'; |
||
20 | /** |
||
21 | * @var string |
||
22 | * 开发者账号ID。由32个英文字母和阿拉伯数字组成的开发者账号唯一标识符。 |
||
23 | */ |
||
24 | private $accountSid; |
||
25 | /** |
||
26 | * @var string |
||
27 | * 开发者账号TOKEN |
||
28 | */ |
||
29 | private $token; |
||
30 | /** |
||
31 | * @var string |
||
32 | * 时间戳 |
||
33 | */ |
||
34 | private $timestamp; |
||
35 | |||
36 | /** |
||
37 | * @param mixed $options 数组参数必填 |
||
38 | * $options = array( |
||
39 | * |
||
40 | * ) |
||
41 | * |
||
42 | * @throws Exception |
||
43 | */ |
||
44 | public function __construct($options) |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | * 包头验证信息,使用Base64编码(账户Id:时间戳) |
||
59 | */ |
||
60 | private function getAuthorization() |
||
66 | |||
67 | /** |
||
68 | * @return string |
||
69 | * 验证参数,URL后必须带有sig参数,sig= MD5(账户Id + 账户授权令牌 + 时间戳,共32位)(注:转成大写) |
||
70 | */ |
||
71 | private function getSigParameter() |
||
77 | |||
78 | /** |
||
79 | * @param string $url |
||
80 | * @param string|null $body |
||
81 | * @param string $type |
||
82 | * @param string $method |
||
83 | * |
||
84 | * @return mixed|string |
||
85 | */ |
||
86 | private function getResult($url, $body, $type, $method) |
||
97 | |||
98 | /** |
||
99 | * @param string $url |
||
100 | * @param string $type |
||
101 | * @param string|null $body |
||
102 | * @param string $method |
||
103 | * |
||
104 | * @return mixed|string |
||
105 | */ |
||
106 | private function connection($url, $body, $type, $method) |
||
152 | |||
153 | /** |
||
154 | * @param $appId |
||
155 | * @param $fromClient |
||
156 | * @param string $to |
||
157 | * @param null $fromSerNum |
||
158 | * @param null $toSerNum |
||
159 | * @param string $type |
||
160 | * |
||
161 | * @throws Exception |
||
162 | * |
||
163 | * @return mixed|string |
||
164 | * @links http://www.ucpaas.com/page/doc/doc_rest3-1.jsp |
||
165 | */ |
||
166 | public function callBack($appId, $fromClient, $to, $fromSerNum = null, $toSerNum = null, $type = 'json') |
||
195 | |||
196 | /** |
||
197 | * @param $appId |
||
198 | * @param $verifyCode |
||
199 | * @param $to |
||
200 | * @param string $type |
||
201 | * |
||
202 | * @throws Exception |
||
203 | * |
||
204 | * @return mixed|string |
||
205 | * @links http://www.ucpaas.com/page/doc/doc_rest3-2.jsp |
||
206 | */ |
||
207 | public function voiceCode($appId, $verifyCode, $to, $type = 'json') |
||
232 | |||
233 | /** |
||
234 | * @param $appId |
||
235 | * @param $to |
||
236 | * @param $templateId |
||
237 | * @param null $param |
||
238 | * @param string $type |
||
239 | * |
||
240 | * @throws Exception |
||
241 | * |
||
242 | * @return mixed|string |
||
243 | * @links http://www.ucpaas.com/page/doc/doc_rest4-1.jsp |
||
244 | */ |
||
245 | public function templateSMS($appId, $to, $templateId, $param = null, $type = 'json') |
||
272 | } |
||
273 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.