We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 294b7c9 + a2d95f3 commit a3f329dCopy full SHA for a3f329d
src/DB.php
@@ -78,8 +78,13 @@ public static function initialize(
78
if (empty($credentials)) {
79
throw new TelegramException('MySQL credentials not provided!');
80
}
81
+ if (isset($credentials['unix_socket'])) {
82
+ $dsn = 'mysql:unix_socket=' . $credentials['unix_socket'];
83
+ } else {
84
+ $dsn = 'mysql:host=' . $credentials['host'];
85
+ }
86
+ $dsn .= ';dbname=' . $credentials['database'];
87
- $dsn = 'mysql:host=' . $credentials['host'] . ';dbname=' . $credentials['database'];
88
if (!empty($credentials['port'])) {
89
$dsn .= ';port=' . $credentials['port'];
90
0 commit comments