Skip to content

Commit

Permalink
update predis connector
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 21, 2025
1 parent d1fc4b6 commit 0948ecc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Illuminate/Redis/Connectors/PredisConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Redis\Connections\PredisClusterConnection;
use Illuminate\Redis\Connections\PredisConnection;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Predis\Client;

class PredisConnector implements Connector
Expand All @@ -27,6 +28,11 @@ public function connect(array $config, array $options)
$formattedOptions['prefix'] = $config['prefix'];
}

if (isset($config['host']) && str_starts_with($config['host'], 'tls://')) {
$config['scheme'] = 'tls';
$config['host'] = Str::after($config['host'], 'tls://');
}

return new PredisConnection(new Client($config, $formattedOptions));
}

Expand Down

0 comments on commit 0948ecc

Please sign in to comment.