当前位置: 动力学知识库 > 问答 > 编程问答 >

php - Register service provider not working in lumen 5.1 for redis

问题描述:

In my lumen bootstrap/app.php I've defined the following service provider

$app->register(Core\Cache\Redis\RedisServiceProvider::class);

But I've noticed that is still using the builtin service provider, which uses Predis client. After searching I found the code below in vendor/laravel-lumen/src/Application.php

protected function registerRedisBindings()

{

$this->singleton('redis', function () {

return $this->loadComponent('database', 'Illuminate\Redis\RedisServiceProvider', 'redis');

});

}

Which seems to be the cause. How can I override this so it uses my service provider instead?

分享给朋友:
您可能感兴趣的文章:
随机阅读: