Skip to content
Ryan Liu edited this page Jan 7, 2015 · 5 revisions

Welcome to the php-ext-handlersocketi wiki!

Connect

    $hs = new HandlerSocketi('127.0.0.1', 9998);
    $fields = ['id', 'username', 'age'];
    $query = $hs->open_index('dbname', 'users', $fields);

Get by primary key

    $result = $query->find(5);
    var_dump($result);

Get by index

    $options = ['index' => 'username'];
    $query = $hs->open_index('dbname', 'users', $fields, $options);
    $result = $query->find('ryan', ['limit' => 1, 'offset' => 0]);
    var_dump($result);
Clone this wiki locally