PHP code example of alexeevdv / yii2-queue-checker
1. Go to this page and download the library: Download alexeevdv/yii2-queue-checker library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace common\components;
use alexeevdv\yii\queue\checker\AlarmInterface;
use yii\base\BaseObject;
use yii\di\Instance;
use yii\httpclient\Client;
class WebhookAlarm extends BaseObject implements AlarmInterface
{
public $httpClient = Client::class;
public $webHook;
public function send($downtime)
{
Instance::ensure($this->httpClient, Client::class)->post($this->webhook, [
'downtime' => $downtime,
]);
}
}