🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 缓存 ### 文件 libraries/Yf/Cache.php 负责初始化并存放所有的Cache类。 // cacah配置信息如下 ``` <pre class="calibre14">``` <span class="token3">define</span><span class="token1">(</span><span class="token4">'CHE'</span><span class="token1">,</span> <span class="token6">1</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span><span class="token6">true</span><span class="token1">)</span> <span class="token1">{</span> <span class="token5">//cache配置参数</span> <span class="token5">//require_once INI_PATH . '/cache.ini.php';</span> $config_cache<span class="token1">[</span><span class="token4">'memcache'</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'base'</span><span class="token1">]</span> <span class="token">=</span> <span class="token1">[</span> <span class="token1">[</span> <span class="token4">'139.196.6.92'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'11211'</span> <span class="token1">]</span><span class="token1">,</span> <span class="token1">]</span><span class="token1">;</span> $config_cache<span class="token1">[</span><span class="token4">'memcache'</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'data'</span><span class="token1">]</span> <span class="token">=</span> <span class="token1">[</span> <span class="token1">[</span> <span class="token4">'139.196.6.92'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'11211'</span> <span class="token1">]</span><span class="token1">,</span> <span class="token1">]</span><span class="token1">;</span> <span class="token1">}</span> <span class="token5">//设置cache 参数</span> <span class="token5">//cacheType 1:file 2:memcache 3:redis 4:apc 5:eA 6:xcache</span> $config_cache<span class="token1">[</span><span class="token4">'default'</span><span class="token1">]</span> <span class="token">=</span> <span class="token1">[</span> <span class="token4">'cacheType'</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span><span class="token1">,</span> <span class="token4">'cacheDir'</span> <span class="token">=</span><span class="token">></span> APP_PATH <span class="token1">.</span> <span class="token4">'/data/cache/default_cache/'</span><span class="token1">,</span> <span class="token4">'memoryCaching'</span> <span class="token">=</span><span class="token">></span> <span class="token6">false</span><span class="token1">,</span> <span class="token4">'automaticSerialization'</span> <span class="token">=</span><span class="token">></span> <span class="token6">true</span><span class="token1">,</span> <span class="token4">'hashedDirectoryLevel'</span> <span class="token">=</span><span class="token">></span> <span class="token6">2</span><span class="token1">,</span> <span class="token4">'lifeTime'</span> <span class="token">=</span><span class="token">></span> <span class="token6">86400</span> <span class="token1">]</span><span class="token1">;</span> $config_cache<span class="token1">[</span><span class="token4">'base'</span><span class="token1">]</span> <span class="token">=</span> <span class="token1">[</span> <span class="token4">'cacheType'</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span><span class="token1">,</span> <span class="token4">'cacheDir'</span> <span class="token">=</span><span class="token">></span> APP_PATH <span class="token1">.</span> <span class="token4">'/data/cache/base_cache/'</span><span class="token1">,</span> <span class="token4">'memoryCaching'</span> <span class="token">=</span><span class="token">></span> <span class="token6">false</span><span class="token1">,</span> <span class="token4">'automaticSerialization'</span> <span class="token">=</span><span class="token">></span> <span class="token6">true</span><span class="token1">,</span> <span class="token4">'hashedDirectoryLevel'</span> <span class="token">=</span><span class="token">></span> <span class="token6">2</span><span class="token1">,</span> <span class="token4">'lifeTime'</span> <span class="token">=</span><span class="token">></span> <span class="token6">86400</span> <span class="token1">]</span><span class="token1">;</span> $config_cache<span class="token1">[</span><span class="token4">'data'</span><span class="token1">]</span> <span class="token">=</span> <span class="token1">[</span> <span class="token4">'cacheType'</span> <span class="token">=</span><span class="token">></span> <span class="token6">1</span><span class="token1">,</span> <span class="token4">'cacheDir'</span> <span class="token">=</span><span class="token">></span> APP_PATH <span class="token1">.</span> <span class="token4">'/data/cache/data_cache/'</span><span class="token1">,</span> <span class="token4">'memoryCaching'</span> <span class="token">=</span><span class="token">></span> <span class="token6">false</span><span class="token1">,</span> <span class="token4">'automaticSerialization'</span> <span class="token">=</span><span class="token">></span> <span class="token6">true</span><span class="token1">,</span> <span class="token4">'hashedDirectoryLevel'</span> <span class="token">=</span><span class="token">></span> <span class="token6">2</span><span class="token1">,</span> <span class="token4">'lifeTime'</span> <span class="token">=</span><span class="token">></span> <span class="token6">86400</span> <span class="token1">]</span><span class="token1">;</span> ``` ``` 调用方法 1.缓存页面 ``` <pre class="calibre14">``` $Cache <span class="token">=</span> Yf_Cache<span class="token1">:</span><span class="token1">:</span><span class="token3">create</span><span class="token1">(</span><span class="token4">'default'</span><span class="token1">)</span><span class="token1">;</span> $site_index_key <span class="token">=</span> <span class="token3">sprintf</span><span class="token1">(</span><span class="token4">'%s|%s|%s'</span><span class="token1">,</span> Yf_Registry<span class="token1">:</span><span class="token1">:</span><span class="token3">get</span><span class="token1">(</span><span class="token4">'server_id'</span><span class="token1">)</span><span class="token1">,</span> <span class="token4">'site_index'</span><span class="token1">,</span> <span class="token3">isset</span><span class="token1">(</span>$_COOKIE<span class="token1">[</span><span class="token4">'sub_site_id'</span><span class="token1">]</span><span class="token1">)</span> <span class="token">?</span> $_COOKIE<span class="token1">[</span><span class="token4">'sub_site_id'</span><span class="token1">]</span> <span class="token1">:</span> <span class="token6">0</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span><span class="token">!</span>$Cache<span class="token">-</span><span class="token">></span><span class="token3">start</span><span class="token1">(</span>$site_index_key<span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> <span class="token5">//其他页面代码。。。</span> $Cache<span class="token">-</span><span class="token">></span>_id <span class="token">=</span> $site_index_key<span class="token1">;</span> $Cache<span class="token">-</span><span class="token">></span><span class="token3">end</span><span class="token1">(</span>$site_index_key<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> ``` ``` 2.缓存数据 ``` <pre class="calibre14">``` $cache_group <span class="token">=</span> <span class="token4">'default'</span><span class="token1">;</span><span class="token5">//配置信息中的缓存key</span> $Cache <span class="token">=</span> Yf_Cache<span class="token1">:</span><span class="token1">:</span><span class="token3">create</span><span class="token1">(</span>$cache_group<span class="token1">)</span><span class="token1">;</span> $key <span class="token">=</span> <span class="token4">''</span><span class="token1">;</span><span class="token5">//缓存key</span> $data <span class="token">=</span> <span class="token4">''</span><span class="token1">;</span><span class="token5">//缓存数据</span> $Cache<span class="token">-</span><span class="token">></span><span class="token3">save</span><span class="token1">(</span>$data<span class="token1">,</span> $key<span class="token1">)</span><span class="token1">;</span><span class="token5">//保存缓存</span> $Cache<span class="token">-</span><span class="token">></span><span class="token3">get</span><span class="token1">(</span>$key<span class="token1">,</span>$cache_group<span class="token1">)</span><span class="token1">;</span> ``` ``` 底层实现 ``` <pre class="calibre15">``` public $_cacheKeyPrefix <span class="token">=</span> <span class="token4">'c|m|'</span><span class="token1">;</span> public $_cacheName <span class="token">=</span> <span class="token4">'default'</span><span class="token1">;</span> public $_tableName <span class="token">=</span> <span class="token4">'test'</span><span class="token1">;</span> public $_tablePrimaryKey <span class="token">=</span> <span class="token4">'test_id'</span><span class="token1">;</span> public $_cacheFlag <span class="token">=</span> <span class="token6">false</span><span class="token1">;</span> <span class="token5">/** * 取得 * * @param array $id * * @return array $rows 信息 * @access protected */</span> protected <span class="token2">function</span> <span class="token3">getCacheRow</span><span class="token1">(</span>$id <span class="token">=</span> <span class="token2">null</span><span class="token1">,</span> <span class="token">&</span>$need_cache_id_name<span class="token1">)</span> <span class="token1">{</span> <span class="token3">fb</span><span class="token1">(</span>$id<span class="token1">)</span><span class="token1">;</span> $rows <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span><span class="token3">is_array</span><span class="token1">(</span>$id<span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> <span class="token2">if</span> <span class="token1">(</span>$this<span class="token">-</span><span class="token">></span>_cacheFlag<span class="token1">)</span> <span class="token1">{</span> $Yf_Cache <span class="token">=</span> Yf_Cache<span class="token1">:</span><span class="token1">:</span><span class="token3">create</span><span class="token1">(</span>$this<span class="token">-</span><span class="token">></span>_cacheName<span class="token1">)</span><span class="token1">;</span> $cache_key <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $cache_key_index <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> foreach <span class="token1">(</span>$id as $item<span class="token1">)</span> <span class="token1">{</span> $cache_key<span class="token1">[</span><span class="token1">]</span> <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>_cacheKeyPrefix <span class="token1">.</span> $item<span class="token1">;</span> $cache_key_index<span class="token1">[</span>$this<span class="token">-</span><span class="token">></span>_cacheKeyPrefix <span class="token1">.</span> $item<span class="token1">]</span> <span class="token">=</span> $item<span class="token1">;</span> <span class="token1">}</span> $rows_cache <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token5">//fix file cache</span> $Yf_Registry <span class="token">=</span> Yf_Registry<span class="token1">:</span><span class="token1">:</span><span class="token3">getInstance</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span><span class="token">!</span><span class="token3">isset</span><span class="token1">(</span>$Yf_Registry<span class="token1">[</span><span class="token4">'config_cache'</span><span class="token1">]</span><span class="token1">[</span>$this<span class="token">-</span><span class="token">></span>_cacheName<span class="token1">]</span><span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> $this<span class="token">-</span><span class="token">></span>_cacheName <span class="token">=</span> <span class="token4">'default'</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">if</span> <span class="token1">(</span><span class="token6">1</span> <span class="token">==</span> $Yf_Registry<span class="token1">[</span><span class="token4">'config_cache'</span><span class="token1">]</span><span class="token1">[</span>$this<span class="token">-</span><span class="token">></span>_cacheName<span class="token1">]</span><span class="token1">[</span><span class="token4">'cacheType'</span><span class="token1">]</span><span class="token1">)</span> <span class="token1">{</span> foreach <span class="token1">(</span>$cache_key as $key_id<span class="token1">)</span> <span class="token1">{</span> $tmp_data <span class="token">=</span> $Yf_Cache<span class="token">-</span><span class="token">></span><span class="token3">get</span><span class="token1">(</span>$key_id<span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span><span class="token6">false</span> <span class="token">===</span> $tmp_data<span class="token1">)</span> <span class="token1">{</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> $rows_cache<span class="token1">[</span>$key_id<span class="token1">]</span> <span class="token">=</span> $tmp_data<span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token5">//end fix file cache</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> $rows_cache <span class="token">=</span> $Yf_Cache<span class="token">-</span><span class="token">></span><span class="token3">get</span><span class="token1">(</span>$cache_key<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> foreach <span class="token1">(</span>$cache_key as $val<span class="token1">)</span> <span class="token1">{</span> <span class="token2">if</span> <span class="token1">(</span><span class="token">!</span><span class="token3">isset</span><span class="token1">(</span>$rows_cache<span class="token1">[</span>$val<span class="token1">]</span><span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> <span class="token3">array_push</span><span class="token1">(</span>$need_cache_id_name<span class="token1">,</span> $cache_key_index<span class="token1">[</span>$val<span class="token1">]</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> $rows <span class="token">=</span> $rows <span class="token">+</span> <span class="token1">(</span>array<span class="token1">)</span>$rows_cache<span class="token1">[</span>$val<span class="token1">]</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token5">//fb($rows, "getCacheRow(" . encode_json($id) . ", " . encode_json($need_cache_id_name) . ")");</span> <span class="token2">return</span> $rows<span class="token1">;</span> <span class="token1">}</span> <span class="token5">/** * 添加缓存,为多条记录 * * @param array $rows_db * * @return array $rows 信息 * @access protected */</span> protected <span class="token2">function</span> <span class="token3">setCacheRow</span><span class="token1">(</span>$rows_db <span class="token">=</span> <span class="token2">null</span><span class="token1">,</span> $expire <span class="token">=</span> <span class="token2">null</span><span class="token1">)</span> <span class="token1">{</span> <span class="token2">if</span> <span class="token1">(</span>$this<span class="token">-</span><span class="token">></span>_cacheFlag<span class="token1">)</span> <span class="token1">{</span> <span class="token2">if</span> <span class="token1">(</span><span class="token6">false</span> <span class="token">!==</span> $rows_db<span class="token1">)</span> <span class="token1">{</span> $Yf_Cache <span class="token">=</span> Yf_Cache<span class="token1">:</span><span class="token1">:</span><span class="token3">create</span><span class="token1">(</span>$this<span class="token">-</span><span class="token">></span>_cacheName<span class="token1">)</span><span class="token1">;</span> foreach <span class="token1">(</span>$rows_db as $key <span class="token">=</span><span class="token">></span> $val<span class="token1">)</span> <span class="token1">{</span> <span class="token5">//fix file cache</span> $Yf_Registry <span class="token">=</span> Yf_Registry<span class="token1">:</span><span class="token1">:</span><span class="token3">getInstance</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span><span class="token">!</span><span class="token3">isset</span><span class="token1">(</span>$Yf_Registry<span class="token1">[</span><span class="token4">'config_cache'</span><span class="token1">]</span><span class="token1">[</span>$this<span class="token">-</span><span class="token">></span>_cacheName<span class="token1">]</span><span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> $this<span class="token">-</span><span class="token">></span>_cacheName <span class="token">=</span> <span class="token4">'default'</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">if</span> <span class="token1">(</span><span class="token6">1</span> <span class="token">==</span> $Yf_Registry<span class="token1">[</span><span class="token4">'config_cache'</span><span class="token1">]</span><span class="token1">[</span>$this<span class="token">-</span><span class="token">></span>_cacheName<span class="token1">]</span><span class="token1">[</span><span class="token4">'cacheType'</span><span class="token1">]</span><span class="token1">)</span> <span class="token1">{</span> $Yf_Cache<span class="token">-</span><span class="token">></span><span class="token3">save</span><span class="token1">(</span><span class="token3">array</span><span class="token1">(</span>$key <span class="token">=</span><span class="token">></span> $val<span class="token1">)</span><span class="token1">,</span> $this<span class="token">-</span><span class="token">></span>_cacheKeyPrefix <span class="token1">.</span> $key<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> $Yf_Cache<span class="token">-</span><span class="token">></span><span class="token3">save</span><span class="token1">(</span><span class="token3">array</span><span class="token1">(</span>$key <span class="token">=</span><span class="token">></span> $val<span class="token1">)</span><span class="token1">,</span> $this<span class="token">-</span><span class="token">></span>_cacheKeyPrefix <span class="token1">.</span> $key<span class="token1">,</span> <span class="token2">null</span><span class="token1">,</span> <span class="token6">0</span><span class="token1">,</span> $expire<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token5">//end fix file cache</span> <span class="token5">/* $Yf_Cache->save(array($key=>$val), $this->_cacheKeyPrefix . $key, null, 0, $expire); //$this->setCache(array($key=>$val), $this->_cacheKeyPrefix . $key); */</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token5">/** * 取得单个缓存 * * @param int $id id * * @return array $rows 信息 * @access protected */</span> protected <span class="token2">function</span> <span class="token3">getCache</span><span class="token1">(</span>$id <span class="token">=</span> <span class="token2">null</span><span class="token1">)</span> <span class="token1">{</span> $rows <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span>$this<span class="token">-</span><span class="token">></span>_cacheFlag<span class="token1">)</span> <span class="token1">{</span> $Yf_Cache <span class="token">=</span> Yf_Cache<span class="token1">:</span><span class="token1">:</span><span class="token3">create</span><span class="token1">(</span>$this<span class="token">-</span><span class="token">></span>_cacheName<span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span>$id<span class="token1">)</span> <span class="token1">{</span> <span class="token2">if</span> <span class="token1">(</span><span class="token3">is_array</span><span class="token1">(</span>$id<span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> $cache_key <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> foreach <span class="token1">(</span>$id as $k <span class="token">=</span><span class="token">></span> $v<span class="token1">)</span> <span class="token1">{</span> $cache_key<span class="token1">[</span><span class="token1">]</span> <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>_cacheKeyPrefix <span class="token1">.</span> $v<span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> $cache_key <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>_cacheKeyPrefix <span class="token1">.</span> $id<span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> $cache_key <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>_cacheKeyPrefix <span class="token1">.</span> <span class="token4">'all'</span><span class="token1">;</span> <span class="token1">}</span> $rows <span class="token">=</span> $Yf_Cache<span class="token">-</span><span class="token">></span><span class="token3">get</span><span class="token1">(</span>$cache_key<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token3">fb</span><span class="token1">(</span>$cache_key<span class="token1">,</span> <span class="token4">'getCache'</span><span class="token1">)</span><span class="token1">;</span> <span class="token3">fb</span><span class="token1">(</span>$rows<span class="token1">)</span><span class="token1">;</span> <span class="token2">return</span> $rows<span class="token1">;</span> <span class="token1">}</span> <span class="token5">/** * 添加缓存,为单条记录 * * @param array $rows_db * * @return array $rows 信息 * @access protected */</span> protected <span class="token2">function</span> <span class="token3">setCache</span><span class="token1">(</span>$rows_db<span class="token1">,</span> $key <span class="token">=</span> <span class="token2">null</span><span class="token1">,</span> $expire <span class="token">=</span> <span class="token2">null</span><span class="token1">)</span> <span class="token1">{</span> <span class="token2">if</span> <span class="token1">(</span>$this<span class="token">-</span><span class="token">></span>_cacheFlag<span class="token1">)</span> <span class="token1">{</span> <span class="token2">if</span> <span class="token1">(</span><span class="token6">false</span> <span class="token">!==</span> $rows_db<span class="token1">)</span> <span class="token1">{</span> $Yf_Cache <span class="token">=</span> Yf_Cache<span class="token1">:</span><span class="token1">:</span><span class="token3">create</span><span class="token1">(</span>$this<span class="token">-</span><span class="token">></span>_cacheName<span class="token1">)</span><span class="token1">;</span> <span class="token5">//fix file cache</span> $Yf_Registry <span class="token">=</span> Yf_Registry<span class="token1">:</span><span class="token1">:</span><span class="token3">getInstance</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span><span class="token">!</span><span class="token3">isset</span><span class="token1">(</span>$Yf_Registry<span class="token1">[</span><span class="token4">'config_cache'</span><span class="token1">]</span><span class="token1">[</span>$this<span class="token">-</span><span class="token">></span>_cacheName<span class="token1">]</span><span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> $this<span class="token">-</span><span class="token">></span>_cacheName <span class="token">=</span> <span class="token4">'default'</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">if</span> <span class="token1">(</span><span class="token6">1</span> <span class="token">==</span> $Yf_Registry<span class="token1">[</span><span class="token4">'config_cache'</span><span class="token1">]</span><span class="token1">[</span>$this<span class="token">-</span><span class="token">></span>_cacheName<span class="token1">]</span><span class="token1">[</span><span class="token4">'cacheType'</span><span class="token1">]</span><span class="token1">)</span> <span class="token1">{</span> <span class="token2">if</span> <span class="token1">(</span>$key<span class="token1">)</span> <span class="token1">{</span> <span class="token2">return</span> $Yf_Cache<span class="token">-</span><span class="token">></span><span class="token3">save</span><span class="token1">(</span>$rows_db<span class="token1">,</span> $this<span class="token">-</span><span class="token">></span>_cacheKeyPrefix <span class="token1">.</span> $key<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> <span class="token2">return</span> $Yf_Cache<span class="token">-</span><span class="token">></span><span class="token3">save</span><span class="token1">(</span>$rows_db<span class="token1">,</span> <span class="token2">null</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> <span class="token2">if</span> <span class="token1">(</span>$key<span class="token1">)</span> <span class="token1">{</span> <span class="token2">return</span> $Yf_Cache<span class="token">-</span><span class="token">></span><span class="token3">save</span><span class="token1">(</span>$rows_db<span class="token1">,</span> $this<span class="token">-</span><span class="token">></span>_cacheKeyPrefix <span class="token1">.</span> $key<span class="token1">,</span> <span class="token2">null</span><span class="token1">,</span> <span class="token6">0</span><span class="token1">,</span> $expire<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> <span class="token2">return</span> $Yf_Cache<span class="token">-</span><span class="token">></span><span class="token3">save</span><span class="token1">(</span>$rows_db<span class="token1">,</span> <span class="token2">null</span><span class="token1">,</span> <span class="token2">null</span><span class="token1">,</span> <span class="token6">0</span><span class="token1">,</span> $expire<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token5">//end fix file cache</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span> ``` ```