Skip to content

smartywhat/TimCache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TimCache

config

[
    'type'=>'memory', 
    'host' => '127.0.0.1', 
    'password'=>'aabbcc', 
    'port'=>6379
]

demo

<?php
require '../vendor/autoload.php';

use TimCache\Cache;


Cache::init(['type'=>'memory', 'host' => '127.0.0.1', 'password'=>'aabbcc', 'port'=>6379]);

Cache::set("aaa", ['aa'=>'cc']);

Cache::set("cc", '1212aaaa');

var_dump(Cache::get("aaa"));

var_dump(Cache::get("cc"));

Cache::set("mynum", 1);
Cache::inc("mynum", 2);

var_dump(Cache::get("mynum"));

var_dump('rm-get');
Cache::rm("mynum");
var_dump(Cache::get("mynum"));

var_dump('put-get');
var_dump(Cache::pull("cc"));
var_dump(Cache::get("cc"));

// Cache::Clear();

Cache::remember("zhonghuaxiaodangjia", function(){
    return '9955113377';
});

var_dump(Cache::get("zhonghuaxiaodangjia"));

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages