PHP code example of takuya / php-sharedmemory-keystore
1. Go to this page and download the library: Download takuya/php-sharedmemory-keystore 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/ */
takuya / php-sharedmemory-keystore example snippets
$uniq_name = 'uniq_name_for_shm'
$store = new ShmArrayStore($uniq_name);
$store['key']=new stdClass();
$obj = $shm->get('key');// instance of MyClass;
// remove ipc
$shm->destroy()
$store = new ShmArrayStore('kvs-like', 1024*1024);
// Set by key
$store->set('key',['msg'=>'Auxakai3']);
// Get by key
$store->get('key')['msg']; // => Auxakai3