Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以把cache 更换成Symfony\Component\Cache包吗? #28

Open
iYting opened this issue Sep 27, 2023 · 2 comments
Open

可以把cache 更换成Symfony\Component\Cache包吗? #28

iYting opened this issue Sep 27, 2023 · 2 comments

Comments

@iYting
Copy link

iYting commented Sep 27, 2023

可以把cache 更换成Symfony\Component\Cache包吗?

@Hanson
Copy link
Owner

Hanson commented Sep 27, 2023

目前此包服务非常多SDK了,不会轻易做任何改动了

@iYting
Copy link
Author

iYting commented Sep 27, 2023

目前此包服务非常多SDK了,不会轻易做任何改动了

$redis =new Redis();
$redis->connect('127.0.0.1', '6379');
$redis->select(2);
$redisCache = new RedisCache();
$redisCache->setRedis($redis);
$config['cache'] = $redisCache;

比如现在的cache用reids做缓存, 要先实例一个Redis 然后写进配置文件里,我想用easywechat那样的 把缓存信息写进配置文件里。

$app= Application::miniProgram([
    'app_id' => '...',
    'secret' => '...',
    'cache'  => [
        'type'       => 'Redis',
        'host'       => '127.0.0.1',
        'port'       => 6379,
        'password'   => '',
        'select'     => 0,
        'prefix'     => '',
        'serialize'  => []
    ]
]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants