Rediska

Follow me on twitter…

Servers

Specify redis servers for which you want datasets to be distributed across:

<?php

$options = array(
    'servers' => array(
        array('host'     => '127.0.0.1',
              'port'     => 6379,
              'password' => 'god',
        ),
        'exampleAlias' => array('host' => '127.0.0.2'),
        array('host' => '127.0.0.3', 'alias' => 'exampleAlias2'),
);

$rediska = new Rediska($options);

?>

Server options

  • host - Redis server host. By default 127.0.0.1
  • port - Redis server port. By default 6379
  • db - Redis server DB index. By default 0
  • alias - Redis server alias. May be used to reference the server (e.g. when you want command to be executed on specific server). Default alias for server is [host]:[port]
  • weight - Weight of Redis server for key distribution. By default 1
  • password - Redis server password. Optional
  • persistent - Persistent connection to Redis server. By default set to false
  • timeout - Connection timeout in seconds. By default get from PHP configuration default_socket_timeout
  • readTimeout - Read timeout for Redis server
  • blockingMode - Blocking/non-blocking mode for reads

Comments

Fork me on GitHub