Download the PHP package junker/hsal without Composer
On this page you can find all versions of the php package junker/hsal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package hsal
HSAL - HandlerSocket Abstraction Layer library for PHP
Requirements
HSAL requires PHP 5.4 or later.
one of handlerSocket Libraries:
- HSPHP (https://github.com/tz-lom/HSPHP)
- Handlersocketi (https://github.com/kjdev/php-ext-handlersocketi) Installation instruction
Installation
The best way to install HSAL is to use a Composer:
php composer.phar require junker/hsal
Examples
API
Methods
__construct($host, $database, $options)
name | description | type |
---|---|---|
host | ip or hostname of HandlerSocket server | string, required |
database | database name | string, required |
options | array of options | assoc array, optional |
Options:
- driver: default HSAL::DRIVER_AUTO
- port_read: read port (int)
- port_write: write port (int)
- timeout: timeout, works only for Handlersocketi driver (double, default: 5)
- rw_timeout: read/write timeout, works only for Handlersocketi driver (double, default: 5)
fetchArray($table, $fields, $index_condition, $operator)
name | description | type |
---|---|---|
table | table name | string, required |
fields | requested fields | array, required |
index_condition | query condition | assoc array, required |
operator | operator for query condition | optional, default: HSAL::OPERATOR_EQUAL |
fetchAssoc($table, $fields, $index_condition, $operator)
name | description | type |
---|---|---|
table | table name | (string, required) |
fields | requested fields | array, required |
index_condition | query condition | assoc array, required |
operator | operator for query condition | optional, default: HSAL::OPERATOR_EQUAL |
fetchColumn($table, $field, $index_condition, $operator)
name | description | type |
---|---|---|
table | table name | string, required |
field | requested field | string, required |
index_condition | query condition | assoc array, required |
operator | operator for query condition | optional, default: HSAL::OPERATOR_EQUAL |
fetchAll($table, $fields, $index_condition, $operator, $limit, $offset)
name | description | type |
---|---|---|
table | table name | string, required |
fields | requested field | string, required |
index_condition | query condition | assoc array, required |
operator | operator for query condition | optional, default: HSAL::OPERATOR_EQUAL |
limit | limit rows | int, optional, default: 1000 |
offset | offset | int, optional, default: 0 |
delete($table, $index_condition, $operator)
name | description | type |
---|---|---|
table | table name | string, required |
index_condition | query condition | assoc array, required |
operator | operator for query condition | optional, default: HSAL::OPERATOR_EQUAL |
insert($table, $values)
name | description | type |
---|---|---|
table | table name | string, required |
values | array of fields with values | assoc array, required |
update($table, $values, $index_condition, $operator)
name | description | type |
---|---|---|
table | table name | string, required |
values | associative array of fields with values | assoc array, required |
index_condition | query condition | assoc array, required |
operator | operator for query condition | optional, default: HSAL::OPERATOR_EQUAL |
increment($table, $field, $index_condition, $operator, $increment)
name | description | type |
---|---|---|
table | table name | string, required |
field | requested field | string, required |
index_condition | query condition | assoc array, required |
operator | operator for query condition | optional, default: HSAL::OPERATOR_EQUAL |
increment | increment value | int, optional, default: 1 |
decrement($table, $field, $index_condition, $operator, $decrement)
name | description | type |
---|---|---|
table | table name | string, required |
field | requested field | string, required |
index_condition | query condition | assoc array, required |
operator | operator for query condition | optional, default: HSAL::OPERATOR_EQUAL |
decrement | decrement value | int, optional, default: 1 |
Roadmap
- php-handlersocket Driver (https://code.google.com/p/php-handlersocket/)
- batch queries
- Authorization