Skip to content

Commit

Permalink
调整一下
Browse files Browse the repository at this point in the history
  • Loading branch information
tourze committed Sep 5, 2015
1 parent f994968 commit 0752a95
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Component/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Cache extends Component
/**
* @var array 保存缓存的容器
*/
protected $_storage = [];
protected $_cache = [];

/**
* @var int 默认过期时间
Expand Down Expand Up @@ -49,12 +49,12 @@ public function setExpired($expired)
*/
public function get($name, $default = null)
{
if ( ! isset($this->_storage[$name]))
if ( ! isset($this->_cache[$name]))
{
return $default;
}

$data = Arr::get($this->_storage, $name);
$data = Arr::get($this->_cache, $name);

// 判断过期时间
$expired = Arr::get($data, 'expired');
Expand All @@ -78,7 +78,7 @@ public function get($name, $default = null)
*/
public function set($name, $value, $expired = null)
{
$this->_storage[$name] = [
$this->_cache[$name] = [
'value' => $value,
'expired' => time() + $expired,
];
Expand All @@ -93,7 +93,7 @@ public function set($name, $value, $expired = null)
*/
public function remove($name)
{
unset($this->_storage[$name]);
unset($this->_cache[$name]);
return true;
}
}

0 comments on commit 0752a95

Please sign in to comment.