clementtalleu / php-redis-om

A PHP object mapper for redis
MIT License
151 stars 7 forks source link

How to configure a spéecifiqueredis / predis client connexion in the GenerateSchema ? #86

Closed azurams closed 1 month ago

azurams commented 1 month ago

In Talleu\RedisOm\Command\GenerateSchema::generateSchema() RedisObjectManager is instanciated with default PredisClient / Redisclient .

How can we configure a specific host / port / database ?

clementtalleu commented 1 month ago

Dis you try to add theses env var ?

REDIS_CLIENT=phpredis REDIS_HOST=<your host> Normally it will be used in the Predis/redis client

I think host/port and database must be set directly as environment variables. I'll take care of it quickly

azurams commented 1 month ago

no i did't, i'll give it a try, But i wonder if redis / predis connection could be injected in RedisObjectMapper with DI / psr11 Container Interface anywhere it could be needed ?

clementtalleu commented 1 month ago

You can add some env var now to use specific host/port

https://github.com/clementtalleu/php-redis-om/pull/87

clementtalleu commented 1 month ago

should update to 0.2.6