Questions tagged [predis]

Predis is a flexible and feature-complete PHP client library for the Redis key-value store.

Predis requires PHP >= 5.3 and it is entirely written in PHP.

It can be used without the need to build and install a native extension for the interpreter, making it also easier and faster to add new features which is great given how fast the development of Redis proceeds.

Speed up Predis

  • support HHVM >= 2.4.0
  • can be paired with a C extension phpiredis

Frameworks integration

Useful links

254 questions
2
votes
2 answers

Redis Connection refuse [tcp://127.0.0.1:6379]

I just setup GeneaLabs/laravel-model-caching packages. When running serve i got redis class missing. Then i run composer required predis/predis After that I got this error No connection could be made because the target machine actively refused it.…
Ali Özen
  • 1,525
  • 2
  • 14
  • 29
2
votes
1 answer

In Redis, what if I need sorted set with RPOPLPUSH functionality?

I made a script that is used to update many clients. The script should be able to be ran in multiple instances. At first Redis will retrieve all client's IDs. Then, each instances of the script will RPOPLPUSH-ing all the clients (update a client and…
notalentgeek
  • 4,939
  • 11
  • 34
  • 53
2
votes
1 answer

PHP Redis invalid DB index

I'm connecting to Redis Labs to use redis for our application. Here is my configurations: $conf=[ 'scheme'=>'tcp', 'host'=>'ec2.cloud.redislabs.com', 'port'=>12860, 'database'=>'selector', 'password'=>'redispassword' ]; Then I do this to load…
somejkuser
  • 8,856
  • 20
  • 64
  • 130
2
votes
1 answer

Fatal error: Class 'Predis\Client' not found

I'm using codeigniter framework. I want to use redis on my project. to do this I find this library: https://packagist.org/packages/predis/predis I installed it with composer. now I want to use it: $client = new Predis\Client(); but I got this…
S.M_Emamian
  • 17,005
  • 37
  • 135
  • 254
2
votes
1 answer

How to detect if Doctrine query is from cache?

I'm trying to use Doctrine Result Caching with Redis and Predis and SncRedisBundle and Symfony. I would like to know if my cache+doctrine+redis+predis+SncRedisBundle configuration is set properly snc_redis: clients: default: …
user6827096
  • 1,186
  • 1
  • 11
  • 26
2
votes
2 answers

Is it possible to have two Predis connection to different databases of the same Redis instance?

I'm trying to create two Predis\Client instances on the same PHP script to separate data belonging to different logical domains. I do this as follows: $param1 = [ 'host' => 'localhost', 'port' => 6379, 'database' =>…
Mattia
  • 43
  • 6
2
votes
1 answer

SncRedisBundle (predis) - heroku : how to configure the DSN

I'm using SncRedisBundle with success locally but can't have it work using heroku. Here is my config : #config.yml imports: - { resource: heroku/parameters_heroku.php } #heroku cloud provider configuration's snc_redis: clients: …
Bruno
  • 1,088
  • 1
  • 13
  • 31
2
votes
0 answers

how to push updated data in Redis with existing query

I've configured Redis for caching and it's working fine. now I'm trying to push data into cache if any data updated in that table. When I'm inserting to the table I unserializing cache and pushing that data. if ($redis->exists($hash . '-results'))…
Arafath
  • 1,090
  • 3
  • 14
  • 28
2
votes
1 answer

How to get the Expire time of redis cache

How to get the expire date from a , I am using Predis to cache the data in hash format. Sample : $redis->hset("taxi_car", "brand", "Toyota");
Lionel Dcosta
  • 177
  • 1
  • 2
  • 13
2
votes
1 answer

Redis scan match performance with large number of keys?

Can't find any info about redis scan match does it mean that if I have 500,000 keys it will iterate over all of them one by one and check if they match the pattern? or it have some other clever trick to pull only relevance keys? if its actually scan…
Amir Bar
  • 3,007
  • 2
  • 29
  • 47
2
votes
1 answer

PHPDoc and Methods Anonymous functions

I am trying to solve an annoying problem with PhpStorm's code validation when it comes to anonymous function. It does not see the passed object's methods. The code snippet below relies on Predis and the pipeline method. startCacheClient()…
SeaFuzz
  • 1,177
  • 9
  • 28
2
votes
1 answer

Composer - illuminate/redis installation fails because of different versions of illuminate/support

I created a fresh installation of Lumen for a new project, and I am trying to setup Redis as the Cache/Session driver. Through composer I was able to install Predis with no issues, and then when trying to run: composer require illuminate/redis I am…
Rabea
  • 1,938
  • 17
  • 26
2
votes
0 answers

how to change L5 jwt-auth Storage - providers.storage to redis

Some one can me help me how to change provider to predis 'storage' => function ($app) { return new Tymon\JWTAuth\Providers\Storage\IlluminateCacheAdapter($app['cache']); }
siva
  • 315
  • 2
  • 11
2
votes
0 answers

Unable to fire a Laravel Event from within a Laravel Redis PUB/SUB Subscriber. [Only happens when I'm interacting with queues]

This only seems to be happening when I am using queues. I have a Node publisher and a Laravel subscriber. The Node publisher sends a message and the Laravel subscriber receives it. When I receive this message, I would like to dispatch a job. If i'm…
2
votes
1 answer

How to pass in options for composer?

I am trying to get this package https://github.com/nrk/predis-async and the instructions says to do: composer require predis/predis-async. I tried downloading the options phpiredis extension but when I run composer it says: Problem 1 -…
Jonatha Suh
  • 195
  • 13