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
0
votes
1 answer

What is the difference between this Redis facade and predis?Laravel

What is the difference between this Redis(facade) and predis? I don’t know the difference between them.
0
votes
2 answers

Is there a way to associate proprieties to chat messages using Redis?

I am trying to build a chat room and I want to store additional information like: nickname, time and avatar then associate them to a message. I might use ':' to separate between some properties but it doesn't sound like an elegant way! $list =…
0
votes
2 answers

Laravel Redis Predis and method GET

i have this function : public function showProfile($id) { // Check if user already in redis with cache key user.1 for example if (!Redis::exists('user.' . $id)) { // If the user is not in redis, fetch it from DB…
0
votes
1 answer

Can't publish because predis is in subscriber mode (Laravel)

I have a command class called RedisSubscribe.php in Laravel 5.7. I want to be able to subscribe to 'message-channel', do some stuff with the message and then publish the message using redis to 'test-channel'. Everything is fine until I have to…
Marissa
  • 185
  • 1
  • 3
  • 13
0
votes
1 answer

Laradock - Running Redis queues with Supervisor throwing the error - Call to undefined function Moontoast\Math\bcadd()

I'm running a Laravel project on Laradock. I have a Job class that handles a Notification class that sends mail. The Job uses Redis for the queue driver and everything is well set up I have Supervisor all set up and working. Below is my .conf file…
suo
  • 599
  • 7
  • 25
0
votes
1 answer

How to use Redis cache in Laravel?

It's my first time to use Laravel and Redis. I understand how to get, set, etc of Redis on Terminal. But no idea how to apply Redis on Laravel application. I have application that saves participant's information in DB with MVC pattern. and I'd like…
Juno J
  • 187
  • 2
  • 11
0
votes
1 answer

Retrieve visitor count from redis 'incrby' and create Popular Post

I have a news website and i want to create popular post based on user visit with interval between 7 Days. I created counting mechanism using Redis::incrby() with prefix : Redis::incrby( 'news:popular:count:' . $news_id . ':' .…
0
votes
2 answers

How to call global object function inside class, getting "Undefined variable" error

I'm creating this simple PHP trying to cache requests on Redis with the Predis library, I instantiated my $redis object outside of the class and I need to call it from inside the class functions. However I keep getting the Undefined variable: redis…
0
votes
3 answers

Connecting to Redis on VM from my localhost PHP application

I have an Ubuntu VM with Redis installed, running on my Windows PC. I have a PHP application that uses Predis to interface with Redis: Predis\Autoloader::register(); try { $redis = new Predis\Client(array( "scheme" => "tcp", "host" =>…
Runicode
  • 291
  • 2
  • 3
  • 19
0
votes
1 answer

Will Predis be able to interact with a newer Redis version?

I'm working on writing a script to compare a couple caching methods my team will be using. I'm trying to set up a Predis client that will interact with the Redis already running there. The Redis that is running on the server is clocking in at…
0
votes
0 answers

How to rename Redis command in Laravel 5?

I'm using Laravel 5.7 with Redis. In my Redis config I renamed some commands following the tutorial Step 5 - Renaming Dangerous Commands in DigitalOcean. I added those lines as an example: rename-command DEL CODE_DEL rename-command CONFIG…
KeitelDOG
  • 4,750
  • 4
  • 18
  • 33
0
votes
0 answers

Executing slave.php file with crontab vs daemon

We have decided to use redis as a message broker for our relatively small project and information out there on how to setup and use redis in production is very minimal. We use redis on aws. I have consulted this example:…
J.Ewa
  • 205
  • 3
  • 14
0
votes
0 answers

Predis, PHP - Iterating through keys using glob not working

So I have the following code: use Predis\Collection\Iterator; static function GetRecords($email) { //this gets the redis client in read/write mode $redis = GetRedisClient(true); $glob = "users:{$email}*"; $i = 0; foreach(new…
janedoe
  • 907
  • 1
  • 13
  • 33
0
votes
1 answer

how to get predis data with offset and limit?

i stored my data as encoded data in redis using predis hset library. so the data is stored in one of the db in a hash name like e.g myHash field = integer value = encoded data.. e.g 1 {'pk_id':1,'name' : 'test1'} 2 {'pk_id':2,'name' :…
sasori
  • 5,249
  • 16
  • 86
  • 138
0
votes
1 answer

How to store codeigniter view file gmap to redis to make view display faster?

I am currently using the Predis library for codeigniter. The redis server am using is version 3.2 the last stable and battle tested version. I have no problem saving, updating and deleting the datas in the redis. But my current problem now is, How…
sasori
  • 5,249
  • 16
  • 86
  • 138