| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?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;
- use think\Container;
- /**
- * 文件类型缓存类
- * @author liu21st <liu21st@gmail.com>
- */
- class Test extends Driver
- {
- protected $options = [
- 'expire' => 0,
- 'cache_subdir' => true,
- 'prefix' => '',
- 'path' => '',
- 'hash_type' => 'md5',
- 'data_compress' => false,
- 'serialize' => true,
- ];
- protected $expire;
- /**
- * 架构函数
- * @param array $options
- */
- public function __construct($options = [])
- {
- return false;
- }
- /**
- * 初始化检查
- * @access private
- * @return boolean
- */
- private function init()
- {
- // 创建项目缓存目录
- try {
- if (!is_dir($this->options['path']) && mkdir($this->options['path'], 0755, true)) {
- return true;
- }
- } catch (\Exception $e) {
- }
- return false;
- }
- }
|