idk/yii2-botman

Yii2 bindings for Botman

Installs: 501

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.0 2018-01-13 15:09 UTC

This package is auto-updated.

Last update: 2020-09-15 18:26:30 UTC


README

Yii2 bindings for Botman.

Latest Stable Version Latest Unstable Version License Total Downloads Build Status codecov

Installation

The preferred method of installation is via Packagist and Composer. Run the following command to install the package and add it as a requirement to your project's composer.json:

composer require idk/yii2-botman

Usage

In order to use Yii2 caching system with Botman, initialize your Botman instance using this:

// create an instance
$botman = BotManFactory::create($botmanConfig, new \idk\yii2\botman\Cache());

Cache storage

By default, yii2-botman will use the default configured Yii::$app->cache component. If you need to use a dedicated cache interface for Botman, you can define it in the botmanCache component like the following:

'components' => [
    // default cache used by your app
    'cache' => [
        'class' => 'yii\caching\DbCache',
    ],
    // specific cache for botman
    'botmanCache' => [
        'class' => 'yii\caching\FileCache',
        'cachePath' => '@runtime/botman',
    ],
]