mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
缓存驱动统一增加handler方法用于获取操作对象的句柄(某些缓存类型可能为null)
This commit is contained in:
12
library/think/cache/Driver.php
vendored
12
library/think/cache/Driver.php
vendored
@@ -16,6 +16,7 @@ namespace think\cache;
|
||||
*/
|
||||
abstract class Driver
|
||||
{
|
||||
protected $handler = null;
|
||||
protected $options = [];
|
||||
protected $tag;
|
||||
|
||||
@@ -173,4 +174,15 @@ abstract class Driver
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回句柄对象,可执行其它高级方法
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function handler()
|
||||
{
|
||||
return $this->handler;
|
||||
}
|
||||
}
|
||||
|
||||
1
library/think/cache/driver/Memcache.php
vendored
1
library/think/cache/driver/Memcache.php
vendored
@@ -16,7 +16,6 @@ use think\Exception;
|
||||
|
||||
class Memcache extends Driver
|
||||
{
|
||||
protected $handler = null;
|
||||
protected $options = [
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 11211,
|
||||
|
||||
1
library/think/cache/driver/Memcached.php
vendored
1
library/think/cache/driver/Memcached.php
vendored
@@ -15,7 +15,6 @@ use think\cache\Driver;
|
||||
|
||||
class Memcached extends Driver
|
||||
{
|
||||
protected $handler;
|
||||
protected $options = [
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 11211,
|
||||
|
||||
11
library/think/cache/driver/Redis.php
vendored
11
library/think/cache/driver/Redis.php
vendored
@@ -22,7 +22,6 @@ use think\cache\Driver;
|
||||
*/
|
||||
class Redis extends Driver
|
||||
{
|
||||
protected $handler = null;
|
||||
protected $options = [
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
@@ -174,14 +173,4 @@ class Redis extends Driver
|
||||
return $this->handler->flushDB();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回句柄对象,可执行其它高级方法
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function handler()
|
||||
{
|
||||
return $this->handler;
|
||||
}
|
||||
}
|
||||
|
||||
1
library/think/cache/driver/Sqlite.php
vendored
1
library/think/cache/driver/Sqlite.php
vendored
@@ -20,7 +20,6 @@ use think\Exception;
|
||||
*/
|
||||
class Sqlite extends Driver
|
||||
{
|
||||
|
||||
protected $options = [
|
||||
'db' => ':memory:',
|
||||
'table' => 'sharedmemory',
|
||||
|
||||
2
library/think/cache/driver/Wincache.php
vendored
2
library/think/cache/driver/Wincache.php
vendored
@@ -25,8 +25,6 @@ class Wincache extends Driver
|
||||
'expire' => 0,
|
||||
];
|
||||
|
||||
protected $tag;
|
||||
|
||||
/**
|
||||
* 架构函数
|
||||
* @param array $options 缓存参数
|
||||
|
||||
Reference in New Issue
Block a user