PHP code example of onliner / materialized
1. Go to this page and download the library: Download onliner/materialized 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/ */
onliner / materialized example snippets
use Onliner\Materialized\Connection;
use Onliner\Materialized\Statement\CreateConnection;
use Onliner\Materialized\Statement\CreateSource;
$connection = Connection::open('pgsl://localhost:6575');
$connection->execute(CreateConnection::kafka('kafka', 'redpanda:9092'));
$connection->execute(CreateSource::kafka('my_source', 'kafka', 'my_topic'));
// Just work with any other PDOStatement
$statement = $connection->fetch('SELECT * FROM my_source');