dev-master
9999999-devSwoft 模型实体缓存
MIT
The Requires
The Development Requires
by 李铭昕
php model db swoole swoft
1.0.2
1.0.2.0Swoft 模型实体缓存
MIT
The Requires
The Development Requires
by 李铭昕
php model db swoole swoft
Swoft 模型实体缓存
Swoft 模型实体缓存, (*1)
# 实体缓存超时时间 ENTITY_CACHE_TTL=3600 # 模型缓存前缀 ENTITY_PREFIX=prefix
config/properties/app.php中增加对应自定义组件, (*3)
return [ ... 'components' => [ 'custom' => [ 'Swoftx\\Db\\Entity\\', ], ], ];
修改实体基类,增加ModelCacheable Trait, (*4)
<?php /** * Swoft Entity Cache * * @author limx <715557344@qq.com> * @link https://github.com/limingxinleo/swoft-entity-cache */ namespace App\Models; use Swoft\Db\Model; use Swoftx\Db\Entity\ModelCacheable; class ModelCache extends Model { use ModelCacheable; }
调用, (*5)
<?php // 从Redis中拿模型实体 $user = User::findOneByCache(1);
Swoft 模型实体缓存
MIT
php model db swoole swoft
Swoft 模型实体缓存
MIT
php model db swoole swoft