host = $host; $this->port = $port; $this->username = $username; $this->password = $password; $this->dbname = $dbname; } function getClient() : ClickHouseDB\Client { $config = [ 'host' => $this->host, 'port' => $this->port, 'username' => $this->username, 'password' => $this->password, ]; $db = new ClickHouseDB\Client($config); if($this->dbname) $db->database($this->dbname); $db->setTimeout(15); $db->setConnectTimeOut(10); return $db; } function send(string $table, array $data) { $this->getClient()->insert($table, array(array_values($data)), array_keys($data)); } }