This is simple implementation of Key-Value database(server and client) using php.
It's 100% covered with PHPUnit and Psalm was able to infer types for 100% of the codebase.
Created for educational purposes, so do not use it in production
Running server:
/usr/bin/php server.php
Client example:
<?php
declare(strict_types=1);
require __DIR__ . '/vendor/autoload.php';
use Amp\ByteStream;
use Amp\Loop;
Loop::run(static function () use ($argv) {
$stdout = ByteStream\getStdout();
$uri = 'tcp://127.0.0.1:31337';
$client = new \Skv\Client\SkvClient(new \Skv\Client\Transport\Tcp\TcpTransport($uri));
$response = (string)(yield $client->set('hello', 'world'));
yield $stdout->write($response . PHP_EOL);
$getResult = yield $client->get('hello');
yield $stdout->write($getResult . PHP_EOL);
});
- Base functional Server (Get/Set methods)
- Base functional Client (Get/Set methods)
- Base type support (string,null)
- Psalm
- Tests with phpunit
- Array type