shieldfy / shieldfy-yii-extension
This is the official PHP SDK for Shieldfy (shieldfy.io)
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 5
Forks: 0
Type:yii2-extension
Requires
- php: ~5.6|~7.0
- ext-curl: *
- shieldfy/shieldfy-php-client: *
This package is not auto-updated.
Last update: 2024-11-10 06:12:33 UTC
README
Require shieldfy Yii 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' => [ ..... ], ];