src/think/cache/driver/Memcache.php 1 location
|
@@ 92-99 (lines=8) @@
|
| 89 |
|
* @param mixed $default 默认值 |
| 90 |
|
* @return mixed |
| 91 |
|
*/ |
| 92 |
|
public function get($name, $default = null) |
| 93 |
|
{ |
| 94 |
|
$this->readTimes++; |
| 95 |
|
|
| 96 |
|
$result = $this->handler->get($this->getCacheKey($name)); |
| 97 |
|
|
| 98 |
|
return false !== $result ? $this->unserialize($result) : $default; |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
/** |
| 102 |
|
* 写入缓存 |
src/think/cache/driver/Memcached.php 1 location
|
@@ 106-113 (lines=8) @@
|
| 103 |
|
* @param mixed $default 默认值 |
| 104 |
|
* @return mixed |
| 105 |
|
*/ |
| 106 |
|
public function get($name, $default = null) |
| 107 |
|
{ |
| 108 |
|
$this->readTimes++; |
| 109 |
|
|
| 110 |
|
$result = $this->handler->get($this->getCacheKey($name)); |
| 111 |
|
|
| 112 |
|
return false !== $result ? $this->unserialize($result) : $default; |
| 113 |
|
} |
| 114 |
|
|
| 115 |
|
/** |
| 116 |
|
* 写入缓存 |
src/think/cache/driver/Redis.php 1 location
|
@@ 112-123 (lines=12) @@
|
| 109 |
|
* @param mixed $default 默认值 |
| 110 |
|
* @return mixed |
| 111 |
|
*/ |
| 112 |
|
public function get($name, $default = null) |
| 113 |
|
{ |
| 114 |
|
$this->readTimes++; |
| 115 |
|
|
| 116 |
|
$value = $this->handler->get($this->getCacheKey($name)); |
| 117 |
|
|
| 118 |
|
if (false === $value || is_null($value)) { |
| 119 |
|
return $default; |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
return $this->unserialize($value); |
| 123 |
|
} |
| 124 |
|
|
| 125 |
|
/** |
| 126 |
|
* 写入缓存 |