PHP code example of clue / redis-server

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

    

clue / redis-server example snippets


$factory = new Factory($loop);
$factory->createServer('localhost:1337')->then(function (Server $server) use ($loop) {
    $server->on('connection', function(Client $client) {
        echo $client->getRemoteAddr() .' connected' . PHP_EOL;    
    });
});

$loop->run();
bash
$ php bin/redis-server.php
bash
$ sudo apt-get install php5-cli git curl
$ git clone https://github.com/clue/php-redis-server.git
$ cd php-redis-server/
$ curl -s https://getcomposer.org/installer | php
$ php composer.phar install