@@ -49,8 +49,6 @@ public function __construct($config){
49
49
$ this ->redirect_uri = $ config ['redirect_uri ' ];
50
50
$ this ->access_token = $ this ->get_access_token ();
51
51
52
- require_once 'FileCache/src/FileCache.php ' ;
53
- $ this ->Cache = new FileCache ();
54
52
55
53
}
56
54
@@ -229,7 +227,7 @@ public function get_auth_user($openid , $access_token , $lang = 'zh_CN'){
229
227
*/
230
228
public function return_data ($ data ){
231
229
232
- if ($ data ['errcode ' ]){
230
+ if (isset ( $ data ['errcode ' ]) ){
233
231
$ this ->error = $ data ['errmsg ' ];
234
232
return false ;
235
233
}else {
@@ -337,7 +335,9 @@ public function http_post($url, $fields, $data_type='json') {
337
335
*/
338
336
public function cache ($ key , $ value = null , $ expire = 3600 ){
339
337
340
- $ cache = $ this ->Cache ;
338
+
339
+ require_once 'FileCache/src/FileCache.php ' ;
340
+ $ cache = new FileCache ();
341
341
342
342
if ($ value ){
343
343
$ result = $ cache ->set ($ key , $ value , $ expire );
@@ -351,7 +351,9 @@ public function cache($key , $value = null , $expire = 3600){
351
351
352
352
public function cacheClear ($ key = null ){
353
353
354
- $ cache = $ this ->Cache ;
354
+ require_once 'FileCache/src/FileCache.php ' ;
355
+ $ cache = new FileCache ();
356
+
355
357
if ($ key ){
356
358
$ have = $ cache ->isHave ($ key );
357
359
if ($ have ){
0 commit comments