junker/handlersocket-service-provider

HandlerSocket Service Provider for Silex

0.2.1 2021-01-06 05:39 UTC

This package is auto-updated.

Last update: 2024-10-06 13:54:58 UTC


README

HandlerSocket Service Provider for Silex

Latest Stable Version Total Downloads License

Requirements

silex 2.x

Installation

The best way to install HandlerSocketServiceProvider is to use a Composer:

composer require junker/handlersocket-service-provider

Examples

use HSAL\HSAL;
use Junker\Silex\Provider\HandlerSocketServiceProvider;

$app->register(new HandlerSocketServiceProvider(), [
    'hs.options' => [
        'host' => 'localhost',
        'dbname' => 'testdb'
    ]
]);

# or

$app->register(new HandlerSocketServiceProvider(), [
    'hs.options' => [
        'driver' => HSAL::DRIVER_HSPHP,
        'host' => 'localhost',
        'dbname' => 'testdb',
        'port_read' => 9998,
        'port_write' => 9999,
        'timeout' => 5
    ]
]);


$page = $app['hs'] = $hs->fetchAssoc('pages', ['id', 'title'], [HSAL::INDEX_PRIMARY => 5]);

Documentation

HSAL Documentation