Ai
1 Star 1 Fork 1

shercode/wechat-php-sdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CI_Wechat.php 1.49 KB
一键复制 编辑 原始数据 按行查看 历史
冯超 提交于 2016-04-05 12:41 +08:00 . Codeigniter Library
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* 微信公众平台PHP-SDK, Codeigniter实例
* @author nigelvon@gmail.com
* @link https://github.com/dodgepudding/wechat-php-sdk
* usage:
* $this->load->library('CI_Wechat');
* $this->ci_wechat->valid();
* ...
*
*/
require_once(dirname(__FILE__) . '/wechat-php-sdk/wechat.class.php');
class CI_Wechat extends Wechat {
protected $_CI;
public function __construct() {
$this->_CI =& get_instance();
$this->_CI->config->load('wechat');
$options = $this->_CI->config->item('wechat');
$this->_CI->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));
parent::__construct($options);
}
/**
* 重载设置缓存
* @param string $cachename
* @param mixed $value
* @param int $expired
* @return boolean
*/
protected function setCache($cachename, $value, $expired) {
return $this->_CI->cache->save($cachename, $value, $expired);
}
/**
* 重载获取缓存
* @param string $cachename
* @return mixed
*/
protected function getCache($cachename) {
return $this->_CI->cache->get($cachename);
}
/**
* 重载清除缓存
* @param string $cachename
* @return boolean
*/
protected function removeCache($cachename) {
return $this->_CI->cache->delete($cachename);
}
}
/* End of file CI_Wechat.php */
/* Location: ./application/libraries/CI_Wechat.php */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/shercode/wechat-php-sdk.git
git@gitee.com:shercode/wechat-php-sdk.git
shercode
wechat-php-sdk
wechat-php-sdk
master

搜索帮助