shieldfy/shieldfy-yii-extension
Composer 安装命令:
composer require shieldfy/shieldfy-yii-extension
包简介
This is the official PHP SDK for Shieldfy (shieldfy.io)
README 文档
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' => [ ..... ], ];
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2018-07-16