imunhatep / rediscli
General-Purpose Library for PHP
Installs: 18 005
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.1.0
- ext-redis: *
- symfony/console: ^3.0|^4.0|^5.0
- symfony/dotenv: ^3.0|^4.0|^5.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-04-04 13:37:40 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