Ai
2 Star 0 Fork 0

ijijni/wechat-php-sdk11

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
TPWechat.class.php 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
binsee 提交于 2015-01-17 01:40 +08:00 . 增加 简单文件缓存实例
<?php
/**
* 微信公众平台PHP-SDK, ThinkPHP实例
* @author dodgepudding@gmail.com
* @link https://github.com/dodgepudding/wechat-php-sdk
* @version 1.2
* usage:
* $options = array(
* 'token'=>'tokenaccesskey', //填写你设定的key
* 'encodingaeskey'=>'encodingaeskey', //填写加密用的EncodingAESKey
* 'appid'=>'wxdk1234567890', //填写高级调用功能的app id
* 'appsecret'=>'xxxxxxxxxxxxxxxxxxx' //填写高级调用功能的密钥
* );
* $weObj = new TPWechat($options);
* $weObj->valid();
* ...
*
*/
class TPWechat extends Wechat
{
/**
* log overwrite
* @see Wechat::log()
*/
protected function log($log){
if ($this->debug) {
if (function_exists($this->logcallback)) {
if (is_array($log)) $log = print_r($log,true);
return call_user_func($this->logcallback,$log);
}elseif (class_exists('Log')) {
Log::write('wechat:'.$log, Log::DEBUG);
return true;
}
}
return false;
}
/**
* 重载设置缓存
* @param string $cachename
* @param mixed $value
* @param int $expired
* @return boolean
*/
protected function setCache($cachename,$value,$expired){
return S($cachename,$value,$expired);
}
/**
* 重载获取缓存
* @param string $cachename
* @return mixed
*/
protected function getCache($cachename){
return S($cachename);
}
/**
* 重载清除缓存
* @param string $cachename
* @return boolean
*/
protected function removeCache($cachename){
return S($cachename,null);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/ijijni/wechat-php-sdk.git
git@gitee.com:ijijni/wechat-php-sdk.git
ijijni
wechat-php-sdk
wechat-php-sdk11
master

搜索帮助