Skip to content

Commit

Permalink
Remove auto refresh.
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Jul 4, 2017
1 parent bdd8d42 commit c21701b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
17 changes: 0 additions & 17 deletions src/Core/AccessToken.php
Expand Up @@ -86,11 +86,6 @@ class AccessToken
*/
protected $prefix = 'easywechat.common.access_token.';

/**
* @var bool
*/
protected $autoRefresh = true;

// API
const API_TOKEN_GET = 'https://api.weixin.qq.com/cgi-bin/token';

Expand Down Expand Up @@ -316,16 +311,4 @@ public function getCacheKey()

return $this->cacheKey;
}

/**
* @param bool $enabled
*
* @return $this
*/
public function autoRefresh($enabled = true)
{
$this->autoRefresh = $enabled;

return $this;
}
}
4 changes: 2 additions & 2 deletions src/Foundation/Application.php
Expand Up @@ -242,11 +242,11 @@ private function registerBase()
}

$this['access_token'] = function () {
return (new AccessToken(
return new AccessToken(
$this['config']['app_id'],
$this['config']['secret'],
$this['cache']
))->autoRefresh($this['config']->get('access_token_auto_refresh', true));
);
};
}

Expand Down

0 comments on commit c21701b

Please sign in to comment.