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

[6.x] Enable Redis in CI #35390

Merged
merged 2 commits into from
Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:

jobs:
linux_tests:

runs-on: ubuntu-latest

services:
mysql:
image: mysql:5.7
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, memcached
tools: composer:v2
coverage: none

Expand Down Expand Up @@ -72,8 +72,8 @@ jobs:
DB_USERNAME: root

windows_tests:

runs-on: windows-latest

strategy:
fail-fast: true
matrix:
Expand All @@ -95,7 +95,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, pdo_mysql, fileinfo, ftp
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, pdo_mysql, fileinfo, ftp, redis, memcached
tools: composer:v2
coverage: none

Expand Down
8 changes: 6 additions & 2 deletions src/Illuminate/Redis/Connectors/PhpRedisConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ protected function establishConnection($client, array $config)
}

if (version_compare(phpversion('redis'), '5.3.0', '>=')) {
$parameters[] = Arr::get($config, 'context');
if (! is_null($context = Arr::get($config, 'context'))) {
$parameters[] = $context;
}
}

$client->{($persistent ? 'pconnect' : 'connect')}(...$parameters);
Expand Down Expand Up @@ -157,7 +159,9 @@ protected function createRedisClusterInstance(array $servers, array $options)
}

if (version_compare(phpversion('redis'), '5.3.2', '>=')) {
$parameters[] = Arr::get($options, 'context');
if (! is_null($context = Arr::get($options, 'context'))) {
$parameters[] = $context;
}
}

return tap(new RedisCluster(...$parameters), function ($client) use ($options) {
Expand Down