180 lines
4.3 KiB
PHP
Executable File
180 lines
4.3 KiB
PHP
Executable File
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
|
// +----------------------------------------------------------------------
|
|
// | Author: liu21st <liu21st@gmail.com>
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace think\cache\driver;
|
|
|
|
use think\cache\Driver;
|
|
|
|
/**
|
|
* Xcache缓存驱动
|
|
* @author liu21st <liu21st@gmail.com>
|
|
*/
|
|
class Xcache extends Driver
|
|
{
|
|
protected $options = [
|
|
'prefix' => '',
|
|
'expire' => 0,
|
|
'serialize' => true,
|
|
];
|
|
|
|
/**
|
|
* 架构函数
|
|
* @access public
|
|
* @param array $options 缓存参数
|
|
* @throws \BadFunctionCallException
|
|
*/
|
|
public function __construct($options = [])
|
|
{
|
|
if (!function_exists('xcache_info')) {
|
|
throw new \BadFunctionCallException('not support: Xcache');
|
|
}
|
|
|
|
if (!empty($options)) {
|
|
$this->options = array_merge($this->options, |