UtilService.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2017/11/02
  6. */
  7. namespace crmeb\services;
  8. use crmeb\exceptions\UtilException;
  9. use think\facade\Config;
  10. use dh2y\qrcode\QRcode;
  11. use crmeb\services\upload\Upload;
  12. class UtilService
  13. {
  14. public static function filtrate($string)
  15. {
  16. $ra = array(
  17. '/([\x00-\x08,\x0b-\x0c,\x0e-\x19])/',
  18. '/script/',
  19. '/javascript/',
  20. '/vbscript/',
  21. '/expression/',
  22. '/applet/',
  23. '/meta/',
  24. '/xml/',
  25. '/blink/',
  26. '/link/',
  27. '/style/',
  28. '/embed/',
  29. '/object/',
  30. '/frame/',
  31. '/layer/',
  32. '/title/',
  33. '/bgsound/',
  34. '/base/',
  35. '/onload/',
  36. '/onunload/',
  37. '/onchange/',
  38. '/onsubmit/',
  39. '/onreset/',
  40. '/onselect/',
  41. '/onblur/',
  42. '/onfocus/',
  43. '/onabort/',
  44. '/onkeydown/',
  45. '/onkeypress/',
  46. '/onkeyup/',
  47. '/onclick/',
  48. '/ondblclick/',
  49. '/onmousedown/',
  50. '/onmousemove/',
  51. '/onmouseout/',
  52. '/onmouseover/',
  53. '/onmouseup/',
  54. '/onunload/',
  55. "/<(\\/?)(script|i?frame|style|html|body|title|link|meta|object|\\?|\\%)([^>]*?)>/isU",
  56. "/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU",
  57. );
  58. $string = preg_replace($ra, '', $string); //删除非打印字符,粗暴式过滤xss可疑字符串
  59. $string = str_replace(array('&', '<', '>'), array('&amp;', '&lt;', '&gt;'), $string);
  60. if (!get_magic_quotes_gpc()) //不对magic_quotes_gpc转义过的字符使用 addslashes(),避免双重转义。
  61. {
  62. $string = addslashes($string); //给单引号(')、双引号(")、反斜线(\)与 NUL(NULL 字符)加上反斜线转义
  63. }
  64. //去除 HTML 和 PHP 标记并转换为 HTML 实体
  65. return htmlentities(strip_tags($string));
  66. }
  67. public static function sweep($array)
  68. {
  69. if (is_array($array)) {
  70. foreach ($array as $k => $v) {
  71. $array[$k] = self::sweep($v);
  72. }
  73. } else {
  74. $array = self::filtrate($array);
  75. }
  76. return $array;
  77. }
  78. /**
  79. * 获取POST请求的数据
  80. * @param $params
  81. * @param null $request
  82. * @param bool $suffix
  83. * @return array
  84. */
  85. public static function postMore($params, $request = null, $suffix = false)
  86. {
  87. if ($request === null) $request = app('request');
  88. $p = [];
  89. $i = 0;
  90. foreach ($params as $param) {
  91. if (!is_array($param)) {
  92. $p[$suffix == true ? $i++ : $param] = self::sweep($request->param($param));
  93. } else {
  94. if (!isset($param[1])) $param[1] = null;
  95. if (!isset($param[2])) $param[2] = '';
  96. if (!isset($param[3])) $param[3] = '';
  97. if (!isset($param[4])) $param[4] = '';
  98. if (!isset($param[5])) $param[5] = '';
  99. if (is_array($param[0])) {
  100. $name = is_array($param[1]) ? $param[0][0] . '/a' : $param[0][0] . '/' . $param[0][1];
  101. $keyName = $param[0][0];
  102. } else {
  103. $name = is_array($param[1]) ? $param[0] . '/a' : $param[0];
  104. $keyName = $param[0];
  105. }
  106. $p[$suffix == true ? $i++ : ($param[3] ? $param[3] : $keyName)] = self::sweep($request->param($name, $param[1], $param[2]));
  107. if (not_empty_check($param[4])) {
  108. if (!is_array($param[4])) {
  109. if (is_string($param[4]) && !function_exists($param[4])) {
  110. throw new UtilException('验证的方法' . $param[4] . '未定义');
  111. }
  112. if (!$param[4]($request->param($name, $param[1], $param[2]))) {
  113. throw new UtilException($param[5]);
  114. }
  115. } else {
  116. foreach ($param[4] as $k => $v) {
  117. if (is_string($v) && !function_exists($v)) {
  118. throw new UtilException('验证的方法' . $v . '未定义');
  119. }
  120. if (!$v($request->param($name, $param[1], $param[2]))) {
  121. throw new UtilException(is_array($param[5]) ? $param[5][$k] : $param[5]);
  122. }
  123. }
  124. }
  125. }
  126. }
  127. }
  128. return $p;
  129. }
  130. /**
  131. * 获取请求的数据
  132. * @param $params
  133. * @param null $request
  134. * @param bool $suffix
  135. * @return array
  136. */
  137. public static function getMore($params, $request = null, $suffix = false)
  138. {
  139. if ($request === null) $request = app('request');
  140. $p = [];
  141. $i = 0;
  142. foreach ($params as $param) {
  143. if (!is_array($param)) {
  144. $p[$suffix == true ? $i++ : $param] = self::sweep($request->param($param));
  145. } else {
  146. if (!isset($param[1])) $param[1] = null;
  147. if (!isset($param[2])) $param[2] = '';
  148. if (!isset($param[3])) $param[3] = '';
  149. if (!isset($param[4])) $param[4] = '';
  150. if (!isset($param[5])) $param[5] = '参数错误';
  151. if (is_array($param[0])) {
  152. $name = is_array($param[1]) ? $param[0][0] . '/a' : $param[0][0] . '/' . $param[0][1];
  153. $keyName = $param[0][0];
  154. } else {
  155. $name = is_array($param[1]) ? $param[0] . '/a' : $param[0];
  156. $keyName = $param[0];
  157. }
  158. $p[$suffix == true ? $i++ : ($param[3] ? $param[3] : $keyName)] = self::sweep($request->param($name, $param[1], $param[2]));
  159. if (not_empty_check($param[4])) {
  160. if (!is_array($param[4])) {
  161. if (is_string($param[4]) && !function_exists($param[4])) {
  162. throw new UtilException('验证的方法' . $param[4] . '未定义');
  163. }
  164. if (!$param[4]($request->param($name, $param[1], $param[2]))) {
  165. throw new UtilException($param[5]);
  166. }
  167. } else {
  168. foreach ($param[4] as $k => $v) {
  169. if (is_string($v) && !function_exists($v)) {
  170. throw new UtilException('验证的方法' . $v . '未定义');
  171. }
  172. if (!$v($request->param($name, $param[1], $param[2]))) {
  173. throw new UtilException(is_array($param[5]) ? $param[5][$k] : $param[5]);
  174. }
  175. }
  176. }
  177. }
  178. }
  179. }
  180. return $p;
  181. }
  182. /**
  183. * TODO 砍价 拼团 分享海报生成
  184. * @param array $data
  185. * @param $path
  186. * @return array|bool|string
  187. * @throws \Exception
  188. */
  189. public static function setShareMarketingPoster($data = array(), $path)
  190. {
  191. $config = array(
  192. 'text' => array(
  193. array(
  194. 'text' => $data['price'],//TODO 价格
  195. 'left' => 116,
  196. 'top' => 200,
  197. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Regular.otf', //字体文件
  198. 'fontSize' => 50, //字号
  199. 'fontColor' => '255,0,0', //字体颜色
  200. 'angle' => 0,
  201. ),
  202. array(
  203. 'text' => $data['label'],//TODO 标签
  204. 'left' => 450,
  205. 'top' => 188,
  206. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Regular.otf', //字体文件
  207. 'fontSize' => 24, //字号
  208. 'fontColor' => '255,255,255', //字体颜色
  209. 'angle' => 0,
  210. ),
  211. array(
  212. 'text' => $data['msg'],//TODO 简述
  213. 'left' => 80,
  214. 'top' => 270,
  215. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Regular.otf', //字体文件
  216. 'fontSize' => 22, //字号
  217. 'fontColor' => '40,40,40', //字体颜色
  218. 'angle' => 0,
  219. )
  220. ),
  221. 'image' => array(
  222. array(
  223. 'url' => $data['image'], //图片
  224. 'stream' => 0,
  225. 'left' => 120,
  226. 'top' => 340,
  227. 'right' => 0,
  228. 'bottom' => 0,
  229. 'width' => 450,
  230. 'height' => 450,
  231. 'opacity' => 100
  232. ),
  233. array(
  234. 'url' => $data['url'], //二维码资源
  235. 'stream' => 0,
  236. 'left' => 260,
  237. 'top' => 890,
  238. 'right' => 0,
  239. 'bottom' => 0,
  240. 'width' => 160,
  241. 'height' => 160,
  242. 'opacity' => 100
  243. )
  244. ),
  245. 'background' => 'static/poster/poster.jpg'
  246. );
  247. if (!file_exists($config['background'])) exception('缺少系统预设背景图片');
  248. if (strlen($data['title']) < 36) {
  249. $text = array(
  250. 'text' => $data['title'],//TODO 标题
  251. 'left' => 76,
  252. 'top' => 100,
  253. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Regular.otf', //字体文件
  254. 'fontSize' => 32, //字号
  255. 'fontColor' => '0,0,0', //字体颜色
  256. 'angle' => 0,
  257. );
  258. array_push($config['text'], $text);
  259. } else {
  260. $titleOne = array(
  261. 'text' => mb_strimwidth($data['title'], 0, 24),//TODO 标题
  262. 'left' => 76,
  263. 'top' => 70,
  264. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Regular.otf', //字体文件
  265. 'fontSize' => 32, //字号
  266. 'fontColor' => '0,0,0', //字体颜色
  267. 'angle' => 0,
  268. );
  269. $titleTwo = array(
  270. 'text' => mb_strimwidth($data['title'], 24, 24),//TODO 标题
  271. 'left' => 76,
  272. 'top' => 120,
  273. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Regular.otf', //字体文件
  274. 'fontSize' => 32, //字号
  275. 'fontColor' => '0,0,0', //字体颜色
  276. 'angle' => 0,
  277. );
  278. array_push($config['text'], $titleOne);
  279. array_push($config['text'], $titleTwo);
  280. }
  281. return self::setSharePoster($config, $path);
  282. }
  283. /**
  284. * TODO 生成分享二维码图片
  285. * @param array $config
  286. * @param $path
  287. * @return array|bool|string
  288. * @throws \Exception
  289. */
  290. public static function setSharePoster($config = array(), $path)
  291. {
  292. $imageDefault = array(
  293. 'left' => 0,
  294. 'top' => 0,
  295. 'right' => 0,
  296. 'bottom' => 0,
  297. 'width' => 100,
  298. 'height' => 100,
  299. 'opacity' => 100
  300. );
  301. $textDefault = array(
  302. 'text' => '',
  303. 'left' => 0,
  304. 'top' => 0,
  305. 'fontSize' => 32, //字号
  306. 'fontColor' => '255,255,255', //字体颜色
  307. 'angle' => 0,
  308. );
  309. $background = $config['background'];//海报最底层得背景
  310. if (substr($background, 0, 1) === '/') {
  311. $background = substr($background, 1);
  312. }
  313. $backgroundInfo = getimagesize($background);
  314. $background = imagecreatefromstring(file_get_contents($background));
  315. $backgroundWidth = $backgroundInfo[0]; //背景宽度
  316. $backgroundHeight = $backgroundInfo[1]; //背景高度
  317. $imageRes = imageCreatetruecolor($backgroundWidth, $backgroundHeight);
  318. $color = imagecolorallocate($imageRes, 0, 0, 0);
  319. imagefill($imageRes, 0, 0, $color);
  320. imagecopyresampled($imageRes, $background, 0, 0, 0, 0, imagesx($background), imagesy($background), imagesx($background), imagesy($background));
  321. if (!empty($config['image'])) {
  322. foreach ($config['image'] as $key => $val) {
  323. $val = array_merge($imageDefault, $val);
  324. $info = getimagesize($val['url']);
  325. $function = 'imagecreatefrom' . image_type_to_extension($info[2], false);
  326. if ($val['stream']) {
  327. $info = getimagesizefromstring($val['url']);
  328. $function = 'imagecreatefromstring';
  329. }
  330. $res = $function($val['url']);
  331. $resWidth = $info[0];
  332. $resHeight = $info[1];
  333. $canvas = imagecreatetruecolor($val['width'], $val['height']);
  334. imagefill($canvas, 0, 0, $color);
  335. imagecopyresampled($canvas, $res, 0, 0, 0, 0, $val['width'], $val['height'], $resWidth, $resHeight);
  336. $val['left'] = $val['left'] < 0 ? $backgroundWidth - abs($val['left']) - $val['width'] : $val['left'];
  337. $val['top'] = $val['top'] < 0 ? $backgroundHeight - abs($val['top']) - $val['height'] : $val['top'];
  338. imagecopymerge($imageRes, $canvas, $val['left'], $val['top'], $val['right'], $val['bottom'], $val['width'], $val['height'], $val['opacity']);//左,上,右,下,宽度,高度,透明度
  339. }
  340. }
  341. if (isset($config['text']) && !empty($config['text'])) {
  342. foreach ($config['text'] as $key => $val) {
  343. $val = array_merge($textDefault, $val);
  344. list($R, $G, $B) = explode(',', $val['fontColor']);
  345. $fontColor = imagecolorallocate($imageRes, $R, $G, $B);
  346. $val['left'] = $val['left'] < 0 ? $backgroundWidth - abs($val['left']) : $val['left'];
  347. $val['top'] = $val['top'] < 0 ? $backgroundHeight - abs($val['top']) : $val['top'];
  348. imagettftext($imageRes, $val['fontSize'], $val['angle'], $val['left'], $val['top'], $fontColor, $val['fontPath'], $val['text']);
  349. }
  350. }
  351. ob_start();
  352. imagejpeg($imageRes);
  353. imagedestroy($imageRes);
  354. $res = ob_get_contents();
  355. ob_end_clean();
  356. $key = substr(md5(rand(0, 9999)), 0, 5) . date('YmdHis') . rand(0, 999999) . '.jpg';
  357. $uploadType = (int)sys_config('upload_type', 1);
  358. $upload = new Upload($uploadType, [
  359. 'accessKey' => sys_config('accessKey'),
  360. 'secretKey' => sys_config('secretKey'),
  361. 'uploadUrl' => sys_config('uploadUrl'),
  362. 'storageName' => sys_config('storage_name'),
  363. 'storageRegion' => sys_config('storage_region'),
  364. ]);
  365. $res = $upload->to($path)->validate()->stream($res, $key);
  366. if ($res === false) {
  367. return $upload->getError();
  368. } else {
  369. $info = $upload->getUploadInfo();
  370. $info['image_type'] = $uploadType;
  371. return $info;
  372. }
  373. }
  374. /**
  375. * TODO 获取小程序二维码是否生成
  376. * @param $url
  377. * @return array
  378. */
  379. public static function remoteImage($url)
  380. {
  381. $curl = curl_init();
  382. curl_setopt($curl, CURLOPT_URL, $url);
  383. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  384. $result = curl_exec($curl);
  385. $result = json_decode($result, true);
  386. if (is_array($result)) return ['status' => false, 'msg' => $result['errcode'] . '---' . $result['errmsg']];
  387. return ['status' => true];
  388. }
  389. /**
  390. * TODO 修改 https 和 http 移动到common
  391. * @param $url $url 域名
  392. * @param int $type 0 返回https 1 返回 http
  393. * @return string
  394. */
  395. public static function setHttpType($url, $type = 0)
  396. {
  397. $domainTop = substr($url, 0, 5);
  398. if ($type) {
  399. if ($domainTop == 'https') $url = 'http' . substr($url, 5, strlen($url));
  400. } else {
  401. if ($domainTop != 'https') $url = 'https:' . substr($url, 5, strlen($url));
  402. }
  403. return $url;
  404. }
  405. /**
  406. * 获取二维码
  407. * @param $url
  408. * @param $name
  409. * @return array|bool|string
  410. */
  411. public static function getQRCodePath($url, $name)
  412. {
  413. if (!strlen(trim($url)) || !strlen(trim($name))) return false;
  414. try {
  415. $uploadType = sys_config('upload_type');
  416. //TODO 没有选择默认使用本地上传
  417. if (!$uploadType) $uploadType = 1;
  418. $uploadType = (int)$uploadType;
  419. $siteUrl = sys_config('site_url');
  420. if (!$siteUrl) return '请前往后台设置->系统设置->网站域名 填写您的域名格式为:http://域名';
  421. $info = [];
  422. $outfile = Config::get('qrcode.cache_dir');
  423. $code = new QRcode();
  424. $wapCodePath = $code->png($url, $outfile . '/' . $name)->getPath(); //获取二维码生成的地址
  425. $content = file_get_contents('.' . $wapCodePath);
  426. if ($uploadType === 1) {
  427. $info["code"] = 200;
  428. $info["name"] = $name;
  429. $info["dir"] = $wapCodePath;
  430. $info["time"] = time();
  431. $info['size'] = 0;
  432. $info['type'] = 'image/png';
  433. $info["image_type"] = 1;
  434. $info['thumb_path'] = $wapCodePath;
  435. return $info;
  436. } else {
  437. $upload = new Upload($uploadType, [
  438. 'accessKey' => sys_config('accessKey'),
  439. 'secretKey' => sys_config('secretKey'),
  440. 'uploadUrl' => sys_config('uploadUrl'),
  441. 'storageName' => sys_config('storage_name'),
  442. 'storageRegion' => sys_config('storage_region'),
  443. ]);
  444. $res = $upload->to($outfile)->validate()->stream($content, $name);
  445. if ($res === false) {
  446. return $upload->getError();
  447. }
  448. $info = $upload->getUploadInfo();
  449. $info['image_type'] = $uploadType;
  450. return $info;
  451. }
  452. } catch (\Exception $e) {
  453. return $e->getMessage();
  454. }
  455. }
  456. /**
  457. * @param array $data
  458. * @param string $path
  459. * @return array|bool|string
  460. * @throws \Exception
  461. */
  462. public static function setShareProductPoster($data = array(), $path = '')
  463. {
  464. $config = array(
  465. 'text' => array(
  466. array(
  467. 'text' => $data['price'],//TODO 价格
  468. 'left' => 219,
  469. 'top' => 1055,
  470. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Regular.otf', //字体文件
  471. 'fontSize' => 50, //字号
  472. 'fontColor' => '131,28,32', //字体颜色
  473. 'angle' => 0,
  474. ),
  475. array(
  476. 'text' => '原价:¥' . $data['ot_price'],//TODO 原价
  477. 'left' => 94,
  478. 'top' => 1105,
  479. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Light-My.otf', //字体文件
  480. 'fontSize' => 18, //字号
  481. 'fontColor' => '0,0,0', //字体颜色
  482. 'angle' => 0,
  483. ),
  484. array(
  485. 'text' => $data['user_nickname'],//TODO 用户名
  486. 'left' => 220,
  487. 'top' => 240,
  488. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Light.ttf', //字体文件
  489. 'fontSize' => 20, //字号
  490. 'fontColor' => '0,0,0', //字体颜色
  491. 'angle' => 0,
  492. ),
  493. array(
  494. 'text' => implode($data['user_nickname_pinyin'], ' '),//TODO 用户名拼音
  495. 'left' => 220,
  496. 'top' => 260,
  497. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Light.ttf', //字体文件
  498. 'fontSize' => 10, //字号
  499. 'fontColor' => '0,0,0', //字体颜色
  500. 'angle' => 0,
  501. ),
  502. ),
  503. 'image' => array(
  504. array(
  505. 'url' => $data['image'], //图片
  506. 'stream' => 0,
  507. 'left' => 94,
  508. 'top' => 359,
  509. 'right' => 0,
  510. 'bottom' => 0,
  511. 'width' => 561,
  512. 'height' => 613,
  513. 'opacity' => 100
  514. ),
  515. array(
  516. 'url' => $data['url'], //二维码资源
  517. 'stream' => 0,
  518. 'left' => 557,
  519. 'top' => 1013,
  520. 'right' => 0,
  521. 'bottom' => 0,
  522. 'width' => 99,
  523. 'height' => 99,
  524. 'opacity' => 100
  525. ),
  526. array(
  527. 'url' => $data['user_avatar'], //头像资源
  528. 'stream' => 0,
  529. 'left' => 98,
  530. 'top' => 211,
  531. 'right' => 0,
  532. 'bottom' => 0,
  533. 'width' => 92,
  534. 'height' => 92,
  535. 'opacity' => 100
  536. )
  537. ),
  538. 'background' => 'static/poster/product.jpg'
  539. );
  540. if (!file_exists($config['background'])) exception('缺少系统预设背景图片');
  541. if (strlen($data['title']) < 27) {
  542. $text = array(
  543. 'text' => $data['title'],//TODO 标题
  544. 'left' => 130,
  545. 'top' => 1172,
  546. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Regular.otf', //字体文件
  547. 'fontSize' => 22, //字号
  548. 'fontColor' => '255,255,255', //字体颜色
  549. 'angle' => 0,
  550. );
  551. array_push($config['text'], $text);
  552. } else {
  553. $titleOne = array(
  554. 'text' => mb_substr($data['title'], 0, 8) . '…',//TODO 标题
  555. 'left' => 130,
  556. 'top' => 1172,
  557. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Regular.otf', //字体文件
  558. 'fontSize' => 22, //字号
  559. 'fontColor' => '255,255,255', //字体颜色
  560. 'angle' => 0,
  561. );
  562. /*$titleTwo = array(
  563. 'text' => mb_substr($data['title'], 12, 12),//TODO 标题
  564. 'left' => 60,
  565. 'top' => 1310,
  566. 'fontPath' => app()->getRootPath() . 'public/static/font/Alibaba-PuHuiTi-Regular.otf', //字体文件
  567. 'fontSize' => 40, //字号
  568. 'fontColor' => '255,255,255', //字体颜色
  569. 'angle' => 0,
  570. );*/
  571. array_push($config['text'], $titleOne);
  572. // array_push($config['text'], $titleTwo);
  573. }
  574. return self::setSharePoster($config, $path);
  575. }
  576. }