|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+<?php
|
|
|
2
|
+/**
|
|
|
3
|
+ * 1688分销严选采购解决方案(分销买家版) - 基础服务类
|
|
|
4
|
+ *
|
|
|
5
|
+ * 提供OAuth 2.0认证、API请求签名、HTTP请求等基础能力
|
|
|
6
|
+ *
|
|
|
7
|
+ * @author: yourname
|
|
|
8
|
+ * @day: 2026/04/27
|
|
|
9
|
+ */
|
|
|
10
|
+
|
|
|
11
|
+namespace app\services\ThirdParty\AlibabaAgent;
|
|
|
12
|
+
|
|
|
13
|
+use crmeb\services\HttpService;
|
|
|
14
|
+use think\facade\Config;
|
|
|
15
|
+use think\facade\Log;
|
|
|
16
|
+
|
|
|
17
|
+class AlibabaAgentBaseService
|
|
|
18
|
+{
|
|
|
19
|
+ /** @var array 配置 */
|
|
|
20
|
+ protected $config;
|
|
|
21
|
+
|
|
|
22
|
+ /** @var string App Key */
|
|
|
23
|
+ protected $appKey;
|
|
|
24
|
+
|
|
|
25
|
+ /** @var string App Secret */
|
|
|
26
|
+ protected $appSecret;
|
|
|
27
|
+
|
|
|
28
|
+ /** @var string 网关地址 */
|
|
|
29
|
+ protected $gatewayUrl;
|
|
|
30
|
+
|
|
|
31
|
+ /** @var string 访问令牌 */
|
|
|
32
|
+ protected $accessToken = '';
|
|
|
33
|
+
|
|
|
34
|
+ /** @var string 刷新令牌 */
|
|
|
35
|
+ protected $refreshToken = '';
|
|
|
36
|
+
|
|
|
37
|
+ /**
|
|
|
38
|
+ * 构造函数
|
|
|
39
|
+ */
|
|
|
40
|
+ public function __construct()
|
|
|
41
|
+ {
|
|
|
42
|
+ $this->config = Config::get('third_party.alibaba_agent', []);
|
|
|
43
|
+ $this->appKey = $this->config['appKey'] ?? '';
|
|
|
44
|
+ $this->appSecret = $this->config['appSecret'] ?? '';
|
|
|
45
|
+ $this->accessToken = $this->config['accessToken'] ?? '';
|
|
|
46
|
+ $this->gatewayUrl = $this->config['gatewayUrl'] ?? 'https://gw.open.1688.com/openapi/';
|
|
|
47
|
+ }
|
|
|
48
|
+
|
|
|
49
|
+ /**
|
|
|
50
|
+ * 设置访问令牌
|
|
|
51
|
+ *
|
|
|
52
|
+ * @param string $accessToken
|
|
|
53
|
+ * @return $this
|
|
|
54
|
+ */
|
|
|
55
|
+ public function setAccessToken(string $accessToken): self
|
|
|
56
|
+ {
|
|
|
57
|
+ $this->accessToken = $accessToken;
|
|
|
58
|
+ return $this;
|
|
|
59
|
+ }
|
|
|
60
|
+
|
|
|
61
|
+ /**
|
|
|
62
|
+ * 设置刷新令牌
|
|
|
63
|
+ *
|
|
|
64
|
+ * @param string $refreshToken
|
|
|
65
|
+ * @return $this
|
|
|
66
|
+ */
|
|
|
67
|
+ public function setRefreshToken(string $refreshToken): self
|
|
|
68
|
+ {
|
|
|
69
|
+ $this->refreshToken = $refreshToken;
|
|
|
70
|
+ return $this;
|
|
|
71
|
+ }
|
|
|
72
|
+
|
|
|
73
|
+ /**
|
|
|
74
|
+ * 获取访问令牌
|
|
|
75
|
+ *
|
|
|
76
|
+ * @return string
|
|
|
77
|
+ */
|
|
|
78
|
+ public function getAccessToken(): string
|
|
|
79
|
+ {
|
|
|
80
|
+ return $this->accessToken;
|
|
|
81
|
+ }
|
|
|
82
|
+
|
|
|
83
|
+ /**
|
|
|
84
|
+ * 获取OAuth 2.0授权URL
|
|
|
85
|
+ *
|
|
|
86
|
+ * @param string $state 防CSRF状态码
|
|
|
87
|
+ * @return string
|
|
|
88
|
+ */
|
|
|
89
|
+ public function getAuthUrl(string $state = ''): string
|
|
|
90
|
+ {
|
|
|
91
|
+ $params = [
|
|
|
92
|
+ 'client_id' => $this->appKey,
|
|
|
93
|
+ 'redirect_uri' => $this->config['redirectUri'] ?? '',
|
|
|
94
|
+ 'response_type' => 'code',
|
|
|
95
|
+ 'state' => $state,
|
|
|
96
|
+ ];
|
|
|
97
|
+ return 'https://auth.1688.com/oauth/authorize?' . http_build_query($params);
|
|
|
98
|
+ }
|
|
|
99
|
+
|
|
|
100
|
+ /**
|
|
|
101
|
+ * 通过授权码获取访问令牌
|
|
|
102
|
+ *
|
|
|
103
|
+ * @param string $code 授权码
|
|
|
104
|
+ * @return array|false
|
|
|
105
|
+ */
|
|
|
106
|
+ public function getAccessTokenByCode(string $code)
|
|
|
107
|
+ {
|
|
|
108
|
+ $url = 'https://gw.open.1688.com/openapi/http/1/system.oauth2/getAccessTokenByCode/' . $this->appKey;
|
|
|
109
|
+
|
|
|
110
|
+ $params = [
|
|
|
111
|
+ 'code' => $code,
|
|
|
112
|
+ 'appKey' => $this->appKey,
|
|
|
113
|
+ 'appSecret' => $this->appSecret,
|
|
|
114
|
+ 'redirect_uri' => $this->config['redirectUri'] ?? '',
|
|
|
115
|
+ 'grant_type' => 'authorization_code',
|
|
|
116
|
+ ];
|
|
|
117
|
+
|
|
|
118
|
+ return $this->parseResponse(
|
|
|
119
|
+ HttpService::postRequest($url, $params)
|
|
|
120
|
+ );
|
|
|
121
|
+ }
|
|
|
122
|
+
|
|
|
123
|
+ /**
|
|
|
124
|
+ * 刷新访问令牌
|
|
|
125
|
+ *
|
|
|
126
|
+ * @param string $refreshToken
|
|
|
127
|
+ * @return array|false
|
|
|
128
|
+ */
|
|
|
129
|
+ public function refreshAccessToken(string $refreshToken)
|
|
|
130
|
+ {
|
|
|
131
|
+ $url = 'https://gw.open.1688.com/openapi/http/1/system.oauth2/getAccessTokenByCode/' . $this->appKey;
|
|
|
132
|
+
|
|
|
133
|
+ $params = [
|
|
|
134
|
+ 'refreshToken' => $refreshToken,
|
|
|
135
|
+ 'appKey' => $this->appKey,
|
|
|
136
|
+ 'appSecret' => $this->appSecret,
|
|
|
137
|
+ 'grant_type' => 'refresh_token',
|
|
|
138
|
+ ];
|
|
|
139
|
+
|
|
|
140
|
+ $result = $this->parseResponse(
|
|
|
141
|
+ HttpService::postRequest($url, $params)
|
|
|
142
|
+ );
|
|
|
143
|
+
|
|
|
144
|
+ if ($result && isset($result['access_token'])) {
|
|
|
145
|
+ $this->setAccessToken($result['access_token']);
|
|
|
146
|
+ if (isset($result['refresh_token'])) {
|
|
|
147
|
+ $this->setRefreshToken($result['refresh_token']);
|
|
|
148
|
+ }
|
|
|
149
|
+ }
|
|
|
150
|
+
|
|
|
151
|
+ return $result;
|
|
|
152
|
+ }
|
|
|
153
|
+
|
|
|
154
|
+ /**
|
|
|
155
|
+ * 生成1688 API签名(param2方式)
|
|
|
156
|
+ *
|
|
|
157
|
+ * 参考可调通的代码:
|
|
|
158
|
+ * $aliParams = array();
|
|
|
159
|
+ * foreach ($code_arr as $key => $val) {
|
|
|
160
|
+ * if (is_array($val)) { $val = json_encode($val); }
|
|
|
161
|
+ * $aliParams[] = $key . $val;
|
|
|
162
|
+ * }
|
|
|
163
|
+ * sort($aliParams);
|
|
|
164
|
+ * $sign_str = join('', $aliParams);
|
|
|
165
|
+ * $sign_str = $param . $apiInfo . $sign_str;
|
|
|
166
|
+ * return strtoupper(bin2hex(hash_hmac("sha1", $sign_str, $appSecret, true)));
|
|
|
167
|
+ *
|
|
|
168
|
+ * @param string $param 协议前缀,如 "param2/1/"
|
|
|
169
|
+ * @param string $apiInfo API路径(含appKey),如 "com.alibaba.fenxiao/jxhy.product.getPageList/6512262"
|
|
|
170
|
+ * @param array $params 所有请求参数(含access_token,不含_aop_signature)
|
|
|
171
|
+ * @return string
|
|
|
172
|
+ */
|
|
|
173
|
+ protected function generateSignature(string $param, string $apiInfo, array $params): string
|
|
|
174
|
+ {
|
|
|
175
|
+ $aliParams = array();
|
|
|
176
|
+ foreach ($params as $key => $val) {
|
|
|
177
|
+ // 数组参数需要json_encode
|
|
|
178
|
+ if (is_array($val)) {
|
|
|
179
|
+ $val = json_encode($val);
|
|
|
180
|
+ }
|
|
|
181
|
+ $aliParams[] = $key . $val;
|
|
|
182
|
+ }
|
|
|
183
|
+ sort($aliParams);
|
|
|
184
|
+ $sign_str = join('', $aliParams);
|
|
|
185
|
+ // 注意顺序: param + apiInfo + 参数拼装
|
|
|
186
|
+ $sign_str = $param . $apiInfo . $sign_str;
|
|
|
187
|
+
|
|
|
188
|
+ return strtoupper(bin2hex(hash_hmac("sha1", $sign_str, $this->appSecret, true)));
|
|
|
189
|
+ }
|
|
|
190
|
+
|
|
|
191
|
+ /**
|
|
|
192
|
+ * 执行API请求(param2方式 - RESTful风格)
|
|
|
193
|
+ *
|
|
|
194
|
+ * @param string $namespace API命名空间
|
|
|
195
|
+ * @param string $name API名称
|
|
|
196
|
+ * @param int $version API版本号
|
|
|
197
|
+ * @param array $businessParams 业务参数
|
|
|
198
|
+ * @return array|false
|
|
|
199
|
+ */
|
|
|
200
|
+ protected function executeParam2(
|
|
|
201
|
+ string $namespace,
|
|
|
202
|
+ string $name,
|
|
|
203
|
+ int $version = 1,
|
|
|
204
|
+ array $businessParams = []
|
|
|
205
|
+ ) {
|
|
|
206
|
+ // param2方式URL格式: https://gw.open.1688.com/openapi/param2/{version}/{namespace}/{name}/{appKey}
|
|
|
207
|
+ // 注意: URL路径最后一部分是 appKey,不是API版本号
|
|
|
208
|
+ $appKey = $this->getConfig('appKey', '');
|
|
|
209
|
+
|
|
|
210
|
+ // 协议前缀: param2/{version}/
|
|
|
211
|
+ $param = 'param2/' . $version . '/';
|
|
|
212
|
+
|
|
|
213
|
+ // API路径(含appKey): {namespace}/{name}/{appKey}
|
|
|
214
|
+ $apiInfo = $namespace . '/' . $name . '/' . $appKey;
|
|
|
215
|
+
|
|
|
216
|
+ // 完整URL(不含query参数,参数通过POST body发送)
|
|
|
217
|
+ $url = rtrim($this->gatewayUrl, '/') . '/' . $param . $apiInfo;
|
|
|
218
|
+
|
|
|
219
|
+ // 所有参数(包括access_token和业务参数)
|
|
|
220
|
+ $allParams = array_merge(
|
|
|
221
|
+ ['access_token' => $this->accessToken],
|
|
|
222
|
+ $businessParams
|
|
|
223
|
+ );
|
|
|
224
|
+
|
|
|
225
|
+ // 生成签名
|
|
|
226
|
+ // 注意: generateSignature($param, $apiInfo, $params)
|
|
|
227
|
+ // sign_str = $param . $apiInfo . 参数拼装
|
|
|
228
|
+ $signature = $this->generateSignature($param, $apiInfo, $allParams);
|
|
|
229
|
+ $allParams['_aop_signature'] = $signature;
|
|
|
230
|
+
|
|
|
231
|
+ $this->logRequest($url, $allParams);
|
|
|
232
|
+
|
|
|
233
|
+ try {
|
|
|
234
|
+ // 使用POST方式发送请求,参数放在POST body中(参考可调通的代码)
|
|
|
235
|
+ $ch = curl_init();
|
|
|
236
|
+ curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
237
|
+ curl_setopt($ch, CURLOPT_POST, true);
|
|
|
238
|
+ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($allParams));
|
|
|
239
|
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
240
|
+ curl_setopt($ch, CURLOPT_TIMEOUT, 15);
|
|
|
241
|
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
242
|
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
243
|
+ curl_setopt($ch, CURLOPT_FAILONERROR, false);
|
|
|
244
|
+ $response = curl_exec($ch);
|
|
|
245
|
+ $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
|
|
246
|
+ $curlError = curl_error($ch);
|
|
|
247
|
+ curl_close($ch);
|
|
|
248
|
+
|
|
|
249
|
+ if ($response === false) {
|
|
|
250
|
+ $this->logError('HTTP请求失败', $curlError ?: '未知curl错误');
|
|
|
251
|
+ return false;
|
|
|
252
|
+ }
|
|
|
253
|
+
|
|
|
254
|
+ $this->logResponse($url, $response);
|
|
|
255
|
+
|
|
|
256
|
+ return $this->parseResponse($response, $httpCode);
|
|
|
257
|
+ } catch (\Exception $e) {
|
|
|
258
|
+ $this->logError('API请求异常', $e->getMessage());
|
|
|
259
|
+ return false;
|
|
|
260
|
+ }
|
|
|
261
|
+ }
|
|
|
262
|
+
|
|
|
263
|
+ /**
|
|
|
264
|
+ * 执行API请求(http方式 - 传统POST方式)
|
|
|
265
|
+ *
|
|
|
266
|
+ * @param string $namespace API命名空间
|
|
|
267
|
+ * @param string $name API名称
|
|
|
268
|
+ * @param int $version API版本号
|
|
|
269
|
+ * @param array $businessParams 业务参数
|
|
|
270
|
+ * @return array|false
|
|
|
271
|
+ */
|
|
|
272
|
+ protected function executeHttp(
|
|
|
273
|
+ string $namespace,
|
|
|
274
|
+ string $name,
|
|
|
275
|
+ int $version = 1,
|
|
|
276
|
+ array $businessParams = []
|
|
|
277
|
+ ) {
|
|
|
278
|
+ // 构建URL: https://gw.open.1688.com/openapi/http/1/cn.alibaba.open/offer.get/1
|
|
|
279
|
+ $url = rtrim($this->gatewayUrl, '/') . '/http/' . $version . '/' . $namespace . '/' . $name . '/' . $version;
|
|
|
280
|
+
|
|
|
281
|
+ // 构建请求参数
|
|
|
282
|
+ $params = [
|
|
|
283
|
+ 'access_token' => $this->accessToken,
|
|
|
284
|
+ 'appKey' => $this->appKey,
|
|
|
285
|
+ 'appSecret' => $this->appSecret,
|
|
|
286
|
+ ];
|
|
|
287
|
+
|
|
|
288
|
+ // 业务参数
|
|
|
289
|
+ if (!empty($businessParams)) {
|
|
|
290
|
+ $params = array_merge($params, $businessParams);
|
|
|
291
|
+ }
|
|
|
292
|
+
|
|
|
293
|
+ $this->logRequest($url, $params);
|
|
|
294
|
+
|
|
|
295
|
+ try {
|
|
|
296
|
+ $response = HttpService::postRequest($url, $params);
|
|
|
297
|
+
|
|
|
298
|
+ $this->logResponse($url, $response);
|
|
|
299
|
+
|
|
|
300
|
+ return $this->parseResponse($response);
|
|
|
301
|
+ } catch (\Exception $e) {
|
|
|
302
|
+ $this->logError('API请求异常', $e->getMessage());
|
|
|
303
|
+ return false;
|
|
|
304
|
+ }
|
|
|
305
|
+ }
|
|
|
306
|
+
|
|
|
307
|
+ /**
|
|
|
308
|
+ * 解析响应
|
|
|
309
|
+ *
|
|
|
310
|
+ * @param string|false $response 响应体
|
|
|
311
|
+ * @param int $httpCode HTTP状态码
|
|
|
312
|
+ * @return array|false
|
|
|
313
|
+ */
|
|
|
314
|
+ protected function parseResponse($response, int $httpCode = 200)
|
|
|
315
|
+ {
|
|
|
316
|
+ if ($response === false || empty($response)) {
|
|
|
317
|
+ $this->logError('HTTP请求失败', '响应为空或请求失败');
|
|
|
318
|
+ return false;
|
|
|
319
|
+ }
|
|
|
320
|
+
|
|
|
321
|
+ $result = json_decode($response, true);
|
|
|
322
|
+
|
|
|
323
|
+ if (json_last_error() !== JSON_ERROR_NONE) {
|
|
|
324
|
+ $this->logError('JSON解析失败', json_last_error_msg() . ' | 原始响应: ' . substr($response, 0, 500));
|
|
|
325
|
+ return false;
|
|
|
326
|
+ }
|
|
|
327
|
+
|
|
|
328
|
+ // HTTP状态码非200,记录错误并返回false
|
|
|
329
|
+ if ($httpCode !== 200) {
|
|
|
330
|
+ $errorMsg = json_encode($result, JSON_UNESCAPED_UNICODE);
|
|
|
331
|
+ $this->logError("HTTP请求失败(status:{$httpCode})", $errorMsg);
|
|
|
332
|
+ return false;
|
|
|
333
|
+ }
|
|
|
334
|
+
|
|
|
335
|
+ // 检查1688 API标准错误格式
|
|
|
336
|
+ if (isset($result['error_code']) || isset($result['errorMessage'])) {
|
|
|
337
|
+ $errorMsg = $result['errorMessage'] ?? ($result['error_message'] ?? '未知错误');
|
|
|
338
|
+ $errorCode = $result['error_code'] ?? ($result['code'] ?? 0);
|
|
|
339
|
+ $this->logError('1688 API错误', "[{$errorCode}] {$errorMsg}");
|
|
|
340
|
+ return false;
|
|
|
341
|
+ }
|
|
|
342
|
+
|
|
|
343
|
+ // 检查result中的错误
|
|
|
344
|
+ if (isset($result['result']) && isset($result['result']['errorCode'])) {
|
|
|
345
|
+ $errorMsg = $result['result']['errorMessage'] ?? '未知错误';
|
|
|
346
|
+ $errorCode = $result['result']['errorCode'];
|
|
|
347
|
+ $this->logError('1688 API业务错误', "[{$errorCode}] {$errorMsg}");
|
|
|
348
|
+ return false;
|
|
|
349
|
+ }
|
|
|
350
|
+
|
|
|
351
|
+ // 检查alibaba标准错误响应格式
|
|
|
352
|
+ if (isset($result['errorResponse']) && isset($result['errorResponse']['code'])) {
|
|
|
353
|
+ $errorMsg = $result['errorResponse']['message'] ?? '未知错误';
|
|
|
354
|
+ $errorCode = $result['errorResponse']['code'];
|
|
|
355
|
+ $this->logError('1688 API错误响应', "[{$errorCode}] {$errorMsg}");
|
|
|
356
|
+ return false;
|
|
|
357
|
+ }
|
|
|
358
|
+
|
|
|
359
|
+ return $result;
|
|
|
360
|
+ }
|
|
|
361
|
+
|
|
|
362
|
+ /**
|
|
|
363
|
+ * 记录请求日志
|
|
|
364
|
+ *
|
|
|
365
|
+ * @param string $url
|
|
|
366
|
+ * @param array $params
|
|
|
367
|
+ */
|
|
|
368
|
+ protected function logRequest(string $url, array $params): void
|
|
|
369
|
+ {
|
|
|
370
|
+ if (!($this->config['logEnabled'] ?? false)) {
|
|
|
371
|
+ return;
|
|
|
372
|
+ }
|
|
|
373
|
+
|
|
|
374
|
+ $logData = [
|
|
|
375
|
+ 'url' => $url,
|
|
|
376
|
+ 'params' => $this->maskSensitiveData($params),
|
|
|
377
|
+ ];
|
|
|
378
|
+
|
|
|
379
|
+ Log::info('[1688分销采购] 请求: ' . json_encode($logData, JSON_UNESCAPED_UNICODE));
|
|
|
380
|
+ }
|
|
|
381
|
+
|
|
|
382
|
+ /**
|
|
|
383
|
+ * 记录响应日志
|
|
|
384
|
+ *
|
|
|
385
|
+ * @param string $url
|
|
|
386
|
+ * @param string|false $response
|
|
|
387
|
+ */
|
|
|
388
|
+ protected function logResponse(string $url, $response): void
|
|
|
389
|
+ {
|
|
|
390
|
+ if (!($this->config['logEnabled'] ?? false)) {
|
|
|
391
|
+ return;
|
|
|
392
|
+ }
|
|
|
393
|
+
|
|
|
394
|
+ Log::info('[1688分销采购] 响应: ' . substr((string)$response, 0, 2000));
|
|
|
395
|
+ }
|
|
|
396
|
+
|
|
|
397
|
+ /**
|
|
|
398
|
+ * 记录错误日志
|
|
|
399
|
+ *
|
|
|
400
|
+ * @param string $title
|
|
|
401
|
+ * @param string $message
|
|
|
402
|
+ */
|
|
|
403
|
+ protected function logError(string $title, string $message): void
|
|
|
404
|
+ {
|
|
|
405
|
+ Log::error("[1688分销采购] {$title}: {$message}");
|
|
|
406
|
+
|
|
|
407
|
+ // 同时写入文件日志
|
|
|
408
|
+ $logPath = $this->config['logPath'] ?? runtime_path() . 'alibaba/';
|
|
|
409
|
+ $logFile = $logPath . 'error_' . date('Y-m-d') . '.log';
|
|
|
410
|
+ $logDir = dirname($logFile);
|
|
|
411
|
+ if (!is_dir($logDir)) {
|
|
|
412
|
+ @mkdir($logDir, 0755, true);
|
|
|
413
|
+ }
|
|
|
414
|
+ @file_put_contents(
|
|
|
415
|
+ $logFile,
|
|
|
416
|
+ '[' . date('Y-m-d H:i:s') . "] {$title}: {$message}\n",
|
|
|
417
|
+ FILE_APPEND
|
|
|
418
|
+ );
|
|
|
419
|
+ }
|
|
|
420
|
+
|
|
|
421
|
+ /**
|
|
|
422
|
+ * 脱敏敏感数据
|
|
|
423
|
+ *
|
|
|
424
|
+ * @param array $data
|
|
|
425
|
+ * @return array
|
|
|
426
|
+ */
|
|
|
427
|
+ protected function maskSensitiveData(array $data): array
|
|
|
428
|
+ {
|
|
|
429
|
+ $sensitiveKeys = ['appSecret', 'access_token', 'refreshToken'];
|
|
|
430
|
+ foreach ($data as $key => $value) {
|
|
|
431
|
+ if (in_array($key, $sensitiveKeys) && is_string($value)) {
|
|
|
432
|
+ $data[$key] = substr($value, 0, 4) . '****' . substr($value, -4);
|
|
|
433
|
+ }
|
|
|
434
|
+ }
|
|
|
435
|
+ return $data;
|
|
|
436
|
+ }
|
|
|
437
|
+
|
|
|
438
|
+ /**
|
|
|
439
|
+ * 获取配置项
|
|
|
440
|
+ *
|
|
|
441
|
+ * @param string $key
|
|
|
442
|
+ * @param mixed $default
|
|
|
443
|
+ * @return mixed
|
|
|
444
|
+ */
|
|
|
445
|
+ protected function getConfig(string $key, $default = null)
|
|
|
446
|
+ {
|
|
|
447
|
+ return $this->config[$key] ?? $default;
|
|
|
448
|
+ }
|
|
|
449
|
+}
|