PHP code example of necromant2005 / tt-ssdb

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

    

necromant2005 / tt-ssdb example snippets


use TweeSSDB\Cache\Storage\Adapter;

$options = new SSDBOptions(array(
    array('host' => '127.0.0.1', 'port' => 8888, 'weight' => 1, 'type' => 'master'),
    array('host' => '127.0.0.2', 'port' => 8888, 'weight' => 2, 'type' => 'slave'),
    array('host' => '127.0.0.3', 'port' => 8888, 'weight' => 2, 'type' => 'slave'),
));
$adapter = new SSDB($options);


use TweeSSDB\Cache\Storage\Adapter;

$options = new SSDBOptions(array(
    array('host' => '127.0.0.1', 'port' => 8888, 'weight' => 1, 'type' => 'master'),
    array('host' => '127.0.0.2', 'port' => 8888, 'weight' => 1, 'type' => 'master'),
    array('host' => '127.0.0.3', 'port' => 8888, 'weight' => 1, 'type' => 'master'),
));
$adapter = new SSDB($options);

bash
$ php composer.phar update