Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7078cdf

Browse files
bug#23045 [Cache] fix Redis scheme detection (xabbuh)
This PR was merged into the 3.2 branch.Discussion----------[Cache] fix Redis scheme detection| Q | A| ------------- | ---| Branch? | 3.2| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#22974| License | MIT| Doc PR |Commits-------61685c7 [Cache] fix Redis scheme detection
2 parents3e92637 +61685c7 commit7078cdf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/Symfony/Component/Cache/Adapter/RedisAdapter.php‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ public static function createConnection($dsn, array $options = array())
9090
$params['dbindex'] =$m[1];
9191
$params['path'] =substr($params['path'],0, -strlen($m[0]));
9292
}
93+
if (isset($params['host'])) {
94+
$scheme ='tcp';
95+
}else {
96+
$scheme ='unix';
97+
}
9398
$params +=array(
9499
'host' =>isset($params['host']) ?$params['host'] :$params['path'],
95100
'port' =>isset($params['host']) ?6379 :null,
@@ -120,7 +125,7 @@ public static function createConnection($dsn, array $options = array())
120125
thrownewInvalidArgumentException(sprintf('Redis connection failed (%s): %s',$e,$dsn));
121126
}
122127
}elseif (is_a($class, \Predis\Client::class,true)) {
123-
$params['scheme'] =isset($params['host']) ?'tcp' :'unix';
128+
$params['scheme'] =$scheme;
124129
$params['database'] =$params['dbindex'] ?:null;
125130
$params['password'] =$auth;
126131
$redis =new$class((newFactory())->create($params));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp