PHP code example of mhthnz / yii2-tarantool

1. Go to this page and download the library: Download mhthnz/yii2-tarantool library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mhthnz / yii2-tarantool example snippets


return [
    'bootstrap' => ['debug'],
    'components' => [
        // Tarantool connection setup
        'tarantool' => [
            'class' => \mhthnz\tarantool\Connection::class,
            'dsn' => 'tcp://username:password@localhost:3301/?connect_timeout=5&max_retries=3',
        ],
    ],
    'modules' => [
        //Debug panel setup
        'debug' => [
            'class' => 'yii\debug\Module',
            'panels' => [
                'tarantool' => [
                    'class' => \mhthnz\tarantool\debug\TarantoolPanel::class,
                    'db' => 'tarantool', // Tarantool component id
                ],
            ],
            'allowedIPs' => ['127.0.0.1', '::1'],
        ],
    ],
];

php composer.phar 
bash
$ sudo apt install php7.3-mbstring php7.3-dom php7.3-intl # specify php version 
bash
$ php composer install

$ php7.3 composer.phar install # or specify php version 
bash
$ php ./vendor/phpunit/phpunit/phpunit --bootstrap ./tests/_bootstrap.php --configuration ./phpunit.xml.dist