|
|
|
@ -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 订单信息 |
|
|
|
@ -156,29 +176,11 @@ class wxpay |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
// 递归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(); |
|
|
|
|
|
|
|
|