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

Throwing exception if redis and predis unavailable #24758

Closed
wants to merge 3 commits into from

Conversation

cryptiklemur
Copy link
Contributor

If the redis extension and predis are unavailable, line 137 throws an exception stating that \Predis\Client is not a class.

Q A
Branch? 3.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets none
License MIT
Doc PR none

If the redis extension and predis are unavailable, the new line 137 throws an exception stating that \Predis\Client is not a class.

If the redis extension and predis are unavailable, line 137 throws an exception stating that \Predis\Client is not a class.
@@ -108,6 +108,9 @@ public static function createConnection($dsn, array $options = array())
$params += $query;
}
$params += $options + self::$defaultConnectionOptions;
if (null === $params['class'] && !extension_loaded('redis') && !class_exists(\Predis\Client::class)) {
throw new \RuntimeException(sprintf('Cannot find the "redis" extension, and "predis/predis" is not installed: %s', $dsn));
Copy link
Member

Choose a reason for hiding this comment

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

Should throw in the Cache namespace.

@fabpot
Copy link
Member

fabpot commented Oct 30, 2017

Thank you @aequasi.

fabpot added a commit that referenced this pull request Oct 30, 2017
This PR was squashed before being merged into the 3.3 branch (closes #24758).

Discussion
----------

Throwing exception if redis and predis unavailable

If the redis extension and predis are unavailable, line 137 throws an exception stating that \Predis\Client is not a class.

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

If the redis extension and predis are unavailable, the new line 137 throws an exception stating that \Predis\Client is not a class.

Commits
-------

e664c81 Throwing exception if redis and predis unavailable
@fabpot fabpot closed this Oct 30, 2017
@cryptiklemur cryptiklemur deleted the patch-1 branch October 30, 2017 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants