PHP code example of twidpay / utils
1. Go to this page and download the library: Download twidpay/utils library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
twidpay / utils example snippets
use Utils\queue\KafkaProducer;
$config = [
'metadata.broker.list' => 'localhost:9092',
'compression.codec' => 'snappy',
'security.protocol' => 'ssl',
//other kafka configuration
];
$this->kafkaProducer = new KafkaProducer($config);
//key is optional
$this->kafkaProducer->produce($topic, $message, $key);