Integrate Yii2

Require shieldfy Yii2 extension

From your console navigate to your application folder and enter the command below:

composer require shieldfy/shieldfy-yii-extension

for more information about composer click here

Add Shieldfy Component

'bootstrap' => ['shieldfy'],
'components' => [
    ...
    'shieldfy' => [
          'class' => 'Shieldfy\Extensions\Yii\BootstrapLoader',
          'appKey' => '<APP_KEY>',
          'appSecret' => '<APP_SECRET>',
    ],
    ...
]

Add Shieldfy DB listener

If you use Yii2 Basic. add shieldfy attachPDO to this file config/db.php

return [
    .....

    'on afterOpen' => function($event) {
            (\Yii::$container->get('shieldfy'))?\Yii::$container->get('shieldfy')->attachPDO($event->sender->pdo):null;
    }
]

If you use Yii2 Advanced. add shieldfy attachPDO to this file common/config/main-local.php

return [
    'components' => [
        'db' => [
            ...
            'on afterOpen' => function($event) {
                (\Yii::$container->get('shieldfy'))?\Yii::$container->get('shieldfy')->attachPDO($event->sender->pdo):null;
            },
        ],
        'mailer' => [
        .....
    ],
];