wearesho-team / yii2-wearesho-notifications-repository
该包已被废弃,不再维护。没有推荐替代包。
1.1.1
2019-05-24 00:55 UTC
Requires
- php: >=7.2
- wearesho-team/wearesho-notifications-repository: ^1.1.0
- yiisoft/yii2: ^2.0.15.1
- yiisoft/yii2-queue: ^2.1
Requires (Dev)
- phpunit/phpunit: ^7.3
- squizlabs/php_codesniffer: ^3.3
This package is auto-updated.
Last update: 2020-07-03 07:54:21 UTC
README
此库帮助在 Yii2 应用中配置 Wearesho Notifications Repository。
它包含
- 引导
- 用于异步推送通知的 yii2-queue 任务
安装
composer require wearesho-team/yii2-wearesho-notifications-repository
用法
将 引导 放入应用程序配置的引导部分
<?php // config/main.php return [ 'id' => '...', 'basePath' => '...', 'bootstrap' => [ 'notifications' => [ 'class' => Wearesho\Notifications\Yii\Bootstrap::class, ], ], ];
在后台执行推送通知
<?php /** @var Wearesho\Notifications\Notification $notification */ Yii::$app->queue->push( new Wearesho\Notifications\Yii\PushNotificationJob([ 'notification' => $notification, ]) );