PHP code example of nokitakaze / keyvalue

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

    

nokitakaze / keyvalue example snippets




// 1
$file_storage = new FileStorage([
    'folder' => '/dev/shm',
]);
$file_storage->set('foo', 'bar');
echo $file_storage->get('foo', 'bar');

// 2
$file_storage = new FileStorage([
    'folder' => '/dev/shm',
]);
$file_storage->set('foo', 'bar');
echo $file_storage->get('foo', 123);

// 3
$redis_storage = new RedisStorage([
    'database' => 1,
]);
$redis_storage->set('foo', 'bar');
echo $redis_storage->get('foo', 'default_value');

// @todo Заменить