imunhatep/rediscli

General-Purpose Library for PHP

0.3.2 2019-12-10 15:08 UTC

This package is auto-updated.

Last update: 2022-01-10 19:47:34 UTC


README

Could be useful in case of executing redis commands out of framework environment. Rediscli uses it's own entrypoint and reads env variables or .env for Redis connection.

E.g. In case Doctrine is configured to store entity proxies inside Redis, sometimes it's required to clean up Redis cache before Doctrine will be able to regenerate entity proxies.

Supported commands:

  • flushdb
  • flushall
Installation:
composer requitre imunhatep/rediscli
Usage example:

Setup:

cd ./bin
ln -s ../vendor/imunhatep/rediscli/bin/redis-cli 
cd ..

flushall example using inline env variables:

REDIS_HOST=1.2.3.4 REDIS_PORT=6379 REDIS_DB=0 ./bin/redis-cli r:c:flushall

flushdb example providing .env:

./bin/redis-cli r:c:flushdb --dot-env=".env"

flushbd if env variables are set in shell

./bin/redis-cli r:c:flushdb