Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 779 Bytes

README.md

File metadata and controls

44 lines (28 loc) · 779 Bytes

PHP Client for PenateDB

Simple client for working with PenadeDB using Guzzle

Installation

$ composer require penate/client

Usage

use Penate\Client\PenateClient;

$penate = new PenateClient('http://localhost:8000');

// Write and read
$penate->setItem('code', 100); // 100
$penate->getItem('code');      // 100

// Operations
$penate->increment('code');    // 101
$penate->decrement('code');    // 100

//Mass call
$penate->setItem('val1', 10);
$penate->setItem('val2', 20);

$penate->getItems(['val1', 'val2']); // [10,20]

You can also set temporary values.

$penate->setItem('temporaryValue', 'Hello', 1);

$penate->getItem('temporaryValue'); // Hello

sleep(120); // after 2 minutes

$penate->getItem('temporaryValue'); // null