mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-05 19:41:44 +08:00
添加微信SDKload方法
This commit is contained in:
parent
7c5eefa4e7
commit
48ce5b20f5
@ -1,4 +1,7 @@
|
||||
<?php
|
||||
use think\Config;
|
||||
use Wechat\Loader;
|
||||
use Wechat\WechatReceive;
|
||||
|
||||
/**
|
||||
* 打印输出数据到文件
|
||||
@ -12,6 +15,22 @@ function p($data, $replace = false, $pathname = NULL) {
|
||||
$replace ? file_put_contents($pathname, $str) : file_put_contents($pathname, $str, FILE_APPEND);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信操作对象
|
||||
* @param string $type
|
||||
* @return WechatReceive
|
||||
*/
|
||||
function & load_wechat($type = '') {
|
||||
static $wechat = array();
|
||||
$index = md5(strtolower($type));
|
||||
if (!isset($wechat[$index])) {
|
||||
$config = Config::get('wechat');
|
||||
$config['cachepath'] = CACHE_PATH . 'wechat' . DS;
|
||||
$wechat[$index] = &Loader::get($type, $config);
|
||||
}
|
||||
return $wechat[$index];
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全URL编码
|
||||
* @param array $data
|
||||
|
Loading…
x
Reference in New Issue
Block a user