iwai / phalcon-model-metadata-redis-adapter

适配Phalcon模型的元数据到Redis。

v1.0.1 2015-02-06 10:19 UTC

This package is not auto-updated.

Last update: 2024-09-14 17:00:48 UTC


README

适配Phalcon模型的元数据到Redis

Latest Stable Version Total Downloads Latest Unstable Version License

用法

use Phalcon\Mvc\Application;
use Iwai\Phalcon\Mvc\Model\MetaData\Redis as MetaDataRedis;

$app = new Application();

$app->getDI()->setShared('modelsMetadata', function () {
    return new MetaDataRedis([
        'host' => '127.0.0.1',
        'port' => 6379,
    ]);
});

选项

host

Redis服务器主机

port

Redis服务器端口

prefix

为Redis设置hset前缀(默认 __metadata

lifetime

设置缓存超时时间(默认 3600 秒)