PHP code example of larryli / yii2-pushbear

1. Go to this page and download the library: Download larryli/yii2-pushbear 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/ */

    

larryli / yii2-pushbear example snippets


'components' => [
    'pushBear' => [
        'class' => \larryli\yii\pushbear\PushBear::class,
        'sendKey' => 'your-SendKey',
    ],
],

try {
    Yii::$app->pushBear->sub('标题', "# 内容标题\n\n- 列表 1\n- 列表 2\n\n[链接](https://github.com/larryli/yii2-pushbear)");
} catch (\larryli\yii\pushbear\Exception $e) {
    echo $e->getMessage();
}

'components' => [
    'log' => [
         'targets' => [
            [
                'class' => \larryli\yii\pushbear\Target::class,
                // 'pushBear' => 'pushBear',
                'levels' => ['error', 'warning'],
                'except' => [ // except self
                    'larryli\yii\pushbear\*',
                    'yii\httpclient\*',
                ],
                'logVars' => [], // disable $_GET and others
            ],
       ],
   ],
],

'components' => [
    'pushBear' => [
        'class' => \larryli\yii\pushbear\PushBear::class,
        'sendKey' => 'your-SendKey',
        'transport' => \yii\httpclient\CurlTransport::class,
    ],
],

'components' => [
    'log' => [
        'targets' => [
            [
                'class' => \yii\log\FileTarget::class,
                'logFile' => '@runtime/logs/http-request.log',
                'categories' => ['yii\httpclient\*'],
            ],
        ],
    ],
],

'bootstrap' => ['debug'],
'modules' => [
    'debug' => [
        'class' => \yii\debug\Module::class,
        'panels' => [
            'httpclient' => [
                'class' => \yii\httpclient\debug\HttpClientPanel::class,
            ],
        ],
    ],
],