欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

thinkphp5redis緩存新增方法實(shí)例講解

 更新時(shí)間:2021年03月22日 11:53:55   作者:科小洋-lmy  
這篇文章主要介紹了thinkphp5redis緩存新增方法實(shí)例講解,redis是項(xiàng)目中最常用的緩存,有正在使用的同學(xué)可以看下

找到該文件
thinkphp/library/think/cache/driver/Redis.php
進(jìn)行新增方法

在這里 我就舉例幾個(gè) 如何添加 添加的方法查看 redis教程

在這里插入圖片描述

/**
   * 返回列表中指定區(qū)間內(nèi)的元素
   * */
  public function lrange($key,$start,$end){

    return $this->handler->lrange($key,$start,$end);

  }
  /**
   * 在list左邊新增元素
   * */
  public function lpush($key,$value){

    return $this->handler->lPush($key,$value);

  }

  /**
   * 在list右邊新增元素
   * */
  public function rpush($key,$value){

    return $this->handler->rPush($key,$value);

  }

  /**
   * 返回并移除列表中的第一個(gè)元素
   * */
  public function lpop($key){

    return $this->handler->lPop($key);

  }

  /**
   * 返回并移除列表的最后一個(gè)元素。
   * */
  public function rpop($key){

    return $this->handler->rPop($key);

  }

如果還需要添加其他的方法 根據(jù)手冊(cè)某個(gè)方法以及傳值
去修改$this->handler-> 后面的方法函數(shù)

到此這篇關(guān)于thinkphp5redis緩存新增方法的文章就介紹到這了,更多相關(guān)thinkphp5 redis緩存新增方法內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論