2017 © Pedro Peláez
 

library tarantool

PHP Tarantool adapter for Bitrix.

image

vuebix/tarantool

PHP Tarantool adapter for Bitrix.

  • Monday, January 29, 2018
  • by mikkie
  • Repository
  • 0 Watchers
  • 0 Stars
  • 3 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 50 % Grown

The README.md

PHP Tarantool adapter for Bitrix

This version of client requires Tarantool 1.8.2 or above and PECL PHP driver for Tarantool, (*1)

Note, (*2)

This library is an example of integration Tarantool with Bitrix.
Strongly NOT RECOMMEND to use on production environment, (*3)

Installation

The recommended way to install the library is through Composer:, (*4)

$ composer require vuebix/tarantool:@dev

Bitrix settings

Add new connection to /bitrix/.settings.php, (*5)

'tarantool' =>
    array (
        'className' => '\\Vuebix\\DB\\TarantoolConnection',
        'port': 3301,
        'host' => '<tarantool>',
        'login' => '<login>',
        'password' => '<password>',
        'sid' => 'tarantool',
    ),

Bitrix ORM entity

<?php

namespace Test{

    use Bitrix\Main\Entity;

    class DemoTable extends Entity\DataManager{

        public static function getConnectionName(){
            return 'tarantool';
        }

        public static function getTableName(){
            return 'table';
        }

        public static function getMap(){
            return [
                new Entity\IntegerField('ID', [
                    'primary' => true,
                    'autocomplete' => true
                ]),
                new Entity\StringField('NAME'),
            ];
        }
    }
}

Usage

<?php

// Get All records
$result = \Test\DemoTable::getList()->fetchAll();
var_dump($result);

// Get record
$result = \Test\DemoTable::getById($id)->fetch();
var_dump($result);

// Add new record
$result = \Test\DemoTable::add($data);
var_dump($result->isSuccess());

// Update record
\Test\DemoTable::update($id, ['NAME' => $name]);
var_dump($result->isSuccess());

// Delete record
$result = \Test\DemoTable::delete($id);
var_dump($result->isSuccess());

License

The library is released under the MIT License. See the bundled LICENSE file for details., (*6)

The Versions

29/01 2018

dev-master

9999999-dev https://bitbucket.org/vuebix/tarantool

PHP Tarantool adapter for Bitrix.

  Sources   Download

MIT

The Requires

  • php >=7.1
  • ext-tarantool *

 

by Mikhail Kriachek

bitrix nosql adapter tarantool