Skip to content

[12.x] Add PhpRedis pack ignore numbers option#56941

Merged
taylorotwell merged 2 commits into
laravel:12.xfrom
tuandp:12.x
Sep 7, 2025
Merged

[12.x] Add PhpRedis pack ignore numbers option#56941
taylorotwell merged 2 commits into
laravel:12.xfrom
tuandp:12.x

Conversation

@tuandp

@tuandp tuandp commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

Description:

  • The connector now checks for the pack_ignore_number key in the config and sets the corresponding Redis option if present.

References:

Testing:
image

@tuandp tuandp changed the title Add PhpRedis pack ignore numbers option [12.x] Add PhpRedis pack ignore numbers option Sep 5, 2025
@taylorotwell taylorotwell merged commit 6ce9d6f into laravel:12.x Sep 7, 2025
63 checks passed
@AhmedAlaa4611

Copy link
Copy Markdown
Contributor

Since #54372 was already merged, could you clarify what gap that this PR is filling? was there something missing in #54372 that required the follow-up?

@tuandp

tuandp commented Sep 10, 2025

Copy link
Copy Markdown
Contributor Author

Since #54372 was already merged, could you clarify what gap that this PR is filling? was there something missing in #54372 that required the follow-up?

@AhmedAlaa4611 this is to allow using OTP_PACK_IGNORE_NUMBERS option in all places. #54372 only covered particular feature which is rate limiter

Example

// database.php
'cache' => [
    'host' => env('REDIS_HOST', '127.0.0.1'),
    'password' => env('REDIS_PASSWORD'),
    'port' => env('REDIS_PORT', '6379'),
    'database' => env('REDIS_CACHE_DB', '1'),
    'options' => [
        'compression' => Redis::COMPRESSION_LZ4
    ],
],

Cache::remember('count', 10, fn () => 1);
Cache::increment('count');
echo Cache::get('count'); // This is always 0 without option 'pack_ignore_number'

tegos pushed a commit to tegos/laravel-framework that referenced this pull request Sep 28, 2025
* Add phpredis pack ignore numbers support

* Update PhpRedisConnector.php

---------

Co-authored-by: Taylor Otwell <taylor@laravel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants