PHP code example of phpolar / phpolar-storage

1. Go to this page and download the library: Download phpolar/phpolar-storage 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/ */

    

phpolar / phpolar-storage example snippets


class KafkaStorage extends AbstractStorage
{
    public function __construct(
        // ...
    ) {
        parent::__construct();
        // ...
    }
    // ...
}


$key0 = new ItemKey(uniqid());

$kafkaStorage->save($key0, $data);

$item0 = $kafkaStorage->getOne($key0);

$numItems = $kafkaStorage->count();

$allItems = $kafkaStorage->getAll();

$kafka->remove($key0);

$kafka->clear();