PHP code example of freedomsex / key-value-storage

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

    

freedomsex / key-value-storage example snippets


use FreedomSex\Services\KeyValueStorage;

// ...

public function __construct(KeyValueStorage $storage) 
{
    $this->storage = $storage;
}

// ...

$storage->save($key, $value, $expires = null);
$storage->load($key, $default = null);

////
// See source
////

// touch, item, clear
// [CounterStorage trait] increment, decrement, count