PHP code example of aerospike / store

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

    

aerospike / store example snippets




$Handler = new AerospikeSessionHandler();
session_set_save_handler($Handler);
session_start();

$db = new Aerospike(["hosts" => [["addr" => "127.0.0.1", "port" => 3000]]]);
$Handler = new AerospikeSessionHandler($db);

$Handler = new AerospikeSessionHandler(NULL, array(
	'addr' => '127.0.0.1',
	'port' => 3000,
	'ns' => 'test',
	'set' => 'session',
	'bin' => 'data',
	'ttl' => 3600 // defualt = session.gc_maxlifetime
));