diff --git a/mobile/plugins/payment/wxpay.php b/mobile/plugins/payment/wxpay.php index 5a5b180..e4ea268 100755 --- a/mobile/plugins/payment/wxpay.php +++ b/mobile/plugins/payment/wxpay.php @@ -91,6 +91,26 @@ class wxpay return $plaintext; } + + /** + * 递归include文件 + */ + public function includeDirectory($directory) { + if ($handle = opendir($directory)) { + while (($file = readdir($handle)) !== false) { + if ($file != '.' && $file != '..') { + $filePath = $directory . '/' . $file; + if (is_dir($filePath)) { + $this->includeDirectory($filePath); // 递归调用,处理子目录 + } elseif (pathinfo($file, PATHINFO_EXTENSION) === 'php') { + include_once $filePath; + echo $filePath . '\n\r'; + } + } + } + closedir($handle); + } + } /** * 生成支付代码 * @param array $order 订单信息 @@ -154,31 +174,13 @@ class wxpay // if ($file != '.' && $file != '..') { // echo $file . "
"; // } - // } - - // 递归include文件 - function includeDirectory($directory) { - if ($handle = opendir($directory)) { - while (($file = readdir($handle)) !== false) { - if ($file != '.' && $file != '..') { - $filePath = $directory . '/' . $file; - if (is_dir($filePath)) { - includeDirectory($filePath); // 递归调用,处理子目录 - } elseif (pathinfo($file, PATHINFO_EXTENSION) === 'php') { - include_once $filePath; - echo $filePath . '\n\r'; - } - } - } - closedir($handle); - } - } + // } $directory = 'helpers/dalianpay'; // 替换为您要包含文件的目录路径 - includeDirectory($directory); + $this->includeDirectory($directory); - require_once(BASE_PATH . 'helpers/dalianpay/demo/dalianpay.php'); - include_once(BASE_PATH . "../plugins/payment/dalianpay/demo/dalianpay.php"); + // require_once(BASE_PATH . 'helpers/dalianpay/demo/dalianpay.php'); + // include_once(BASE_PATH . "../plugins/payment/dalianpay/demo/dalianpay.php"); $new_plugin = new dalianpay();