How does laravel Redis::get implement the call?

The

document is only a brief description, but there is no https://laravel-china.org/doc.

that explains how to call it.

clipboard.png

there is no get method found in the file Illuminate\ Redis\ RedisServiceProvider.php .

Aug.05,2021

look at what the provider finally parses. RedisServiceProvider finally parses all the methods that RedisManager, interacts with redis in this manager


found cache
dump (get_class (Cache::getFacadeRoot (); / / IlluminateCacheCacheManager

) in laravel china.
$cache->get();
    
CacheManager::__call()
    
$this->store()
    
$this->get($name); <- $name = $this->getDefaultDriver();
    
$this->resolve($name);
    
$this->createRedisDriver($config); <- $config = $this->getConfig($name);
    
$this->repository(new RedisStore($redis, $this->getPrefix($config), $connection));
    
return $repository = new Repository($store);

public function get($key, $default = null)
    {
//$this->store Illuminate\Cache\MemcachedStore getmemcached() 
dump($this->store->getmemcached()->getstats());//config/cache.php memcached servers  
"127.0.0.1:11222" => array:79 [
    "pid" => 21134
    "uptime" => 11833735
    "time" => 1539067642
    "version" => "1.5.5"
    "libevent" => "1.4.13-stable"
    "pointer_size" => 64
    "rusage_user" => 3575.933375
    "rusage_system" => 7384.440394
    "max_connections" => 20000
    "curr_connections" => 11
    "total_connections" => 1387317
    "rejected_connections" => 0
    "connection_structures" => 49
    "reserved_fds" => 20
    "cmd_get" => 148806806
    "cmd_set" => 338487
    "cmd_flush" => 5
    "cmd_touch" => 0
    "get_hits" => 292110
    "get_misses" => 148514696
    "get_expired" => 19255
    "get_flushed" => 0
    "delete_misses" => 4345
    "delete_hits" => 16787
    "incr_misses" => 1
    "incr_hits" => 0
    "decr_misses" => 0
    "decr_hits" => 0
    "cas_misses" => 0
    "cas_hits" => 0
    "cas_badval" => 0
    "touch_hits" => 0
    "touch_misses" => 0
    "auth_cmds" => 0
    "auth_errors" => 0
    "bytes_read" => 9071506444
    "bytes_written" => 5734670757
    "limit_maxbytes" => 536870912
    "accepting_conns" => 1
    "listen_disabled_num" => 0
    "time_in_listen_disabled_us" => 0
    "threads" => 4
    "conn_yields" => 0
    "hash_power_level" => 16
    "hash_bytes" => 524288
    "hash_is_expanding" => 0
    "slab_reassign_rescues" => 0
    "slab_reassign_chunk_rescues" => 0
    "slab_reassign_evictions_nomem" => 0
    "slab_reassign_inline_reclaim" => 0
    "slab_reassign_busy_items" => 0
    "slab_reassign_busy_deletes" => 0
    "slab_reassign_running" => 0
    "slabs_moved" => 0
    "lru_crawler_running" => 0
    "lru_crawler_starts" => 844425
    "lru_maintainer_juggles" => 312647046
    "malloc_fails" => 0
    "log_worker_dropped" => 0
    "log_worker_written" => 0
    "log_watcher_skipped" => 0
    "log_watcher_sent" => 0
    "bytes" => 270
    "curr_items" => 1
    "total_items" => 338080
    "slab_global_page_pool" => 0
    "expired_unfetched" => 249665
    "evicted_unfetched" => 0
    "evicted_active" => 0
    "evictions" => 0
    "reclaimed" => 275081
    "crawler_reclaimed" => 10485
    "crawler_items_checked" => 121614
    "lrutail_reflocked" => 9500
    "moves_to_cold" => 264414
    "moves_to_warm" => 77551
    "moves_within_lru" => 18524
    "direct_reclaims" => 0
    "lru_bumps_dropped" => 0
  ]
        $value = $this->store->get($key);

        if (is_null($value))
        {
            $this->fireCacheEvent('missed', [$key]);

            $value = value($default);
        }
        else
        {
            $this->fireCacheEvent('hit', [$key, $value]);
        }

        return $value;
    }

$memcache = new Memcache; $memcache->addServer('localhost', 11213); $memcache->addServer('localhost', 11214); $memcache->addServer('localhost', 11215); $memStats =
 $memcache->getExtendedStats(); print_r($memStats);

http://php.net/manual/zh/memcache.addserver.php addServer 
:https://blog.csdn.net/clh604/article/details/19682427?utm_source=copy 
 https://www.cnblogs.com/vania/p/6004397.html 
http://www.cnblogs.com/qiantuwuliang/archive/2011/03/07/1974499.html
https://www.cnblogs.com/mxw09/archive/2011/08/16/2141457.html
Menu