国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

webman Cache 返回錯誤

Youfeed

出現(xiàn)BUG原因

webman/support/helpers.php
里面 測試時候?qū)憘€ 測試函數(shù)

我 Youfeed 豬頭三

bug描述

在 functions 里將Cache 封成方法調(diào)用,set成功 get 返回 $redis

輔助函數(shù) app/functions.php

use support\Db;
use support\Redis;
use support\Cache;

/*
* Redis 緩存設(shè)置
* @$key,$val[]
*/
if(!function_exists('cache_set')){
  function cache_set($key,$val,$second=10){
    return Cache::set("cache-$key",$val,$second);
  }
}
/*
* Redis 緩存獲取
* @$key
*/
if(!function_exists('cache_get')){
  function cache_get($key){
    return Cache::get("cache-$key");
  }
}

控制器代碼 app/controller/IndexController.php

<?php
namespace app\controller;
use support\Request;

class ApiController 
{
  // 測試
  public function test()
  {
    $set = cache_set('x','123456',60); // TRUE
    $get = cache_get('x'); // $redis
    return [$set,$get];
  }
}

期待的結(jié)果及實際結(jié)果

期望:cache_get('x'); 返回set的值
實際:cache_get('x'); 返回 "$redis"

確認(rèn)下 在輔助方法里面 是否可以調(diào)用 Cache::get

composer.json

"require": {
    "php": ">=7.2",
    "workerman/webman-framework": "^1.4.7",
    "monolog/monolog": "^2.0",
    "psr/container": "^1.1.1",
    "illuminate/database": "^8.83",
    "illuminate/redis": "^8.2.0",
    "illuminate/events": "^8.83",
    "symfony/cache": "^5.2",
    "webman/console": "^1.2.12"
  },
1319 2 0
2個回答

yzh52521

測試沒問題

喵了個咪

估計是開啟了redis事務(wù)吧

年代過于久遠(yuǎn),無法發(fā)表回答
??