Join 4,000+ others and never miss out on new tips, tutorials, and more.
4.x is outdated, please check the latest version 25.x
Latest version:
pecl install openswoole-25.2.0
Swoole\Database\MysqliConfig->withHost
Swoole\Database\MysqliConfig->withUnixSocket
Swoole\Database\MysqliConfig->withPort
Swoole\Database\MysqliConfig->withDbname
Swoole\Database\MysqliConfig->withCharset
Swoole\Database\MysqliConfig->withUsername
Swoole\Database\MysqliConfig->withPassword
Swoole\Database\MysqliConfig->withOptions
Swoole\Database\MysqliConfig->withHost(string $host)
Swoole\Database\MysqliConfig->withPort(int $port)
Swoole\Database\MysqliConfig->withTimeout(float $timeout)
Swoole\Database\MysqliConfig->withReserved(string $reserved)
Swoole\Database\MysqliConfig->withRetryInterval(int $retry_interval)
Swoole\Database\MysqliConfig->withReadTimeout(float $read_timeout)
Swoole\Database\MysqliConfig->withAuth(string $auth)
Swoole\Database\MysqliConfig->withDbIndex(int $dbIndex)
<?php
(new MysqliConfig())
->withHost(MYSQL_SERVER_HOST)
->withPort(MYSQL_SERVER_PORT)
// ->withUnixSocket('/tmp/mysql.sock')
->withDbName(MYSQL_SERVER_DB)
->withCharset('utf8mb4')
->withUsername(MYSQL_SERVER_USER)
->withPassword(MYSQL_SERVER_PWD)