Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.4] Add support for PhpRedis #15160

Merged
merged 1 commit into from
Sep 16, 2016
Merged

Conversation

tillkruss
Copy link
Contributor

I messed up the branch and didn't know how to recover. This is the original PR: #14850

Followup from laravel/docs#2500 to add PhpRedis support to Laravel, because it's significatly faster than Predis.

This is a proof of concept. Feedback/suggestions are greatly appreciated.

  • Illuminate\Redis\Database is now an abstract class.
  • PredisDatabase and PhpRedisDatabase were introduced, extending Illuminate\Redis\Database
  • Laravel uses Illuminate\Contracts\Redis\Database instead of Illuminate\Redis\Database in most places.
  • Illuminate/Cache/RedisStore and Illuminate/Cache/Repository now check key existence using null or false.
  • Laravel will use Predis as default unless the config value database.redis.client is set to phpredis.
  • Predis connection parameters are mapped to the slightly different Redis and RedisCluster parameters.
  • I've pointed the core alias for redis to the abstract Illuminate\Redis\Database class. I'm not sure if that's correct, or if we need a Redis Database Manager or similar.

To test/use this:

  • Rename (or uncomment) Redis facade in config/app.php.
  • Add 'client' => 'phpredis', to redis array in config/database.php.

@GrahamCampbell GrahamCampbell changed the base branch from 5.3 to master August 30, 2016 16:09
@GrahamCampbell GrahamCampbell changed the title [5.3] Add support for PhpRedis [5.4] Add support for PhpRedis Aug 30, 2016
@GrahamCampbell GrahamCampbell changed the base branch from master to 5.3 August 30, 2016 16:11
@GrahamCampbell GrahamCampbell changed the base branch from 5.3 to master August 30, 2016 16:11
@@ -31,12 +31,12 @@ class RedisStore extends TaggableStore implements Store
/**
* Create a new Redis store.
*
* @param \Illuminate\Redis\Database $redis
* @param \Illuminate\Contracts\Redis\Database $redis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've set the target of this PR to 5.4 due to this breaking change.

@taylorotwell taylorotwell merged commit ec34852 into laravel:master Sep 16, 2016
@taylorotwell
Copy link
Member

Is it possible for us to get integration tests on this?

@taylorotwell
Copy link
Member

We'll also need some docs on the master branch of the docs. Thanks!

@tillkruss
Copy link
Contributor Author

tillkruss commented Sep 16, 2016

Sure thing. I'll work on that this weekend. I'm slammed with work at the moment, I'll do this soon.

*/
public function psubscribe($channels, Closure $callback, $connection = null)
{
$this->psubscribe($channels, $callback, $connection, __FUNCTION__);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a typo, should be $this->subscribe(...)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please send a PR. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@tillkruss tillkruss deleted the phpredis-support branch September 21, 2016 18:33
@dzgrief
Copy link

dzgrief commented Oct 22, 2016

Now I am using laravel 5.3, is this feature can support 5.3 ?

@tillkruss
Copy link
Contributor Author

It's coming in 5.4.

For 5.3 you need to use this package https://github.com/tillkruss/laravel-phpredis

@halaei
Copy link
Contributor

halaei commented Jan 7, 2017

@tillkruss Can you please tell why you made this change:

Illuminate/Cache/RedisStore and Illuminate/Cache/Repository now check key existence using null or false.

I think it should be reverted.

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.

6 participants