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->withHostSwoole\Database\MysqliConfig->withUnixSocketSwoole\Database\MysqliConfig->withPortSwoole\Database\MysqliConfig->withDbnameSwoole\Database\MysqliConfig->withCharsetSwoole\Database\MysqliConfig->withUsernameSwoole\Database\MysqliConfig->withPasswordSwoole\Database\MysqliConfig->withOptionsSwoole\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)