🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] > [鸟哥博客](http://www.laruence.com/2013/03/18/2846.html) > [github](https://github.com/laruence/yac) ## 概述 - 支持 window - 支持过期时间 ## 安装 `sudo pecl install yac` ## ini ``` yac.enable = 1 yac.keys_memory_size = 4M ; 4M can get 30K key slots, 32M can get 100K key slots yac.values_memory_size = 64M yac.compress_threshold = -1 yac.enable_cli = 0 ; whether enable yac with cli, default 0 ``` ## demo ``` Yac { /* 属性 */ protected $_prefix ; /* 方法 */ public __construct ( string $prefix = "" ) public add ( string $keys , mixed $value , int $ttl = 0 ) : bool public add ( array $key_vals ) : bool public delete ( string|array $keys , int $ttl = ? ) : bool public dump ( int $$num ) : mixed public flush ( ) : bool public get ( string|array $key , int &$cas = null ) : mixed public __get ( string $key ) : mixed public info ( ) : array public set ( string $keys , mixed $value , int $ttl = 0 ) : bool public add ( array $key_vals ) : bool public __set ( string $keys , mixed $value ) : mixed } ```